2 Replies Latest reply on Sep 21, 2011 8:33 PM by user12944061

    AftExportToDat Event Script

      I would like to reformat a text file produced using the pull adapter. I think I can use an AftExportToDat event script to read the file produced and re-write in the needed format. How do I determine the name of the text file produced from the Export step?

      Edited by: user12944061 on Sep 20, 2011 11:10 AM
        • 1. Re: AftExportToDat Event Script
          The entire path of the file produced by the standard Export is strFile from:

          Sub AftExportToDat(strLoc, strCat, strPer, strTCat, strTPer, strFile)

          AftExportToDat runs several times during Export, so you may want to include something like the following at the beginning of AftExportToDat to avoid unexpected results:

          Select Case LCase(Right(strFile,6))
               Case "-a.dat", "-b.dat", "-c.dat" Exit Sub
          End Select

          I'm not sure how to determine the name of the file generated by the Pull Adapter. Can you add the Pull Adapter's type library into the Object Explorer in Workbench?
          • 2. Re: AftExportToDat Event Script
            The name of the file produced by the pull adapter is in the strFile parameter of the AftExportToDat event script.

            Thanks for the tip that the script may be executed more than once. I would have been scrarching my head trying to figure out what was happening.