4 Replies Latest reply on May 30, 2013 7:26 AM by SH_INT

    FDM Mapping SPLIT/TRIM/JOIN fields

    user8819264
      Hi All

      I am using FDM to Transform a flat file to a new data file. I am a newbie in FDM.

      Can anybody tell me the syntax for trimming/splitting the source field in to the target file in FDM mapping.

      For Example:

      In my source, the feild 'Product' has string "uranium FGIM (10010)
      But on the target file, I need only the product code '10010' How do i trim this feild to get the desired output file.

      Kindly let me know the syntax of the mapping.

      Thank you,
      JK
        • 1. Re: FDM Mapping SPLIT/TRIM/JOIN fields
          user8819264
          I tried it like this with the 'Like' mapping

          Rule Name = '*'

          Rule Desc = '*'

          Rule Definition = '*'

          Target = '#SCRIPT'

          SCRIPT =

          X_STRING = LEFT(RIGHT(varValues(16), 6),5)
          Result = X_STRING


          But it gives me the error below

          Error: An error occurred importing the file.
          Detail: Invalid procedure call or argument

          Any Help Highly appreciated

          Thank you,
          JK
          • 2. Re: FDM Mapping SPLIT/TRIM/JOIN fields
            SH_INT
            You can either do this as part of the mapping process or you can use an import script to parse out the desired value during the import.

            If you do it in the mapping simply use your original full product string as the source and set the trimmed value as the target i.e. using explicit maps

            In the import script use logic similar to your example to parse out the portion of the original product string you wish to pass as the source value. However you must ensure this logic is generic and will work consistently over all product strings.

            From your criteria I imagine the mapping approach would be the simplest and easiest to manage solution
            1 person found this helpful
            • 3. Re: FDM Mapping SPLIT/TRIM/JOIN fields
              user8819264
              Thanks for the reply. I managed to do that through Import script. But the exported file doesn't have the headers. Is there an option to export the data with its header?

              Thank you.
              • 4. Re: FDM Mapping SPLIT/TRIM/JOIN fields
                SH_INT
                The standard export functionality will not create a header row. You will need to customise the adapter Export Action script to achieve your desired output
                1 person found this helpful