add record

  • 06 Dec

    How to add a record to a csv file

    How to add a record to a csv file

    Q: I have a job which is processed through another bit of software, I get 1 file in and at the end of the process, I can have over 100 data files.

    I need to add a record to the start of each file with the same structure, the fields can be empty but I do need to populate 2 of the fields.

    • Sequence fields needs to be 000000
    • Outname fields needs to be the name of the data file

    I then need to add a record at the end of the file but only 1 field needs to be populated

    • Sequence = 999999

    Is this achievable in Limagito? I can do this within the software that processes the data but it will be a very long process to set up.

    A: This should be possible using our scripting option.

    • We used a Windows folder as Source:

    limagito file mover windows folder as source

    • We added the following Include Filename filter because we want to be sure we only are going to handle csv files:

    limagito filemover filename filter

    • As Destination we used our PScript (Pascal Script) option:

    limagito filemover destination setup

    • Please add the following Pascal Script
      • Please add the following script: link
      • Do not forget to adjust the ctOutputPath ( path must end with a \ )
        • This is the path where the adjusted csv files will be saved

    limagito file mover add a record to a csv file

    • Example content of csv source file before changes:

    limagito filemover csv example file

    • Example content of csv destination file after changes:

    limagito file mover example csv file

    Feedback customer:

    You are an absolute legend. Thank you very much

    If you need any help with this “add a record to a csv file” question, please let us know.

    Best Regards,

    Limagito Team

    #csv #managedfiletransfer #filetransfer #filemanagement

    By Limagito-Team CSV Pascal Script ,
SEARCH