How to remove the header row from a CSV file
Q: We have a CSV file that contains a header row. Is it possible for Limagito to remove the first row in the file when we move it to a new folder? Both the start and ending locations are on a windows server.
A: Yes, this is possible. Please have a look at the following screenshots.
- The customer is using a Windows folder as Source so we used this also in our example:
- We added an include filename filter so we are 100% we’ll only pickup .csv files:
- In our Destination setup we added our ‘Pascal Script’ option:
- Please add the following script (v1): link
- We also added an alternative for the first script. In this script you can enable or disable the “TrailingLineBreak = finishing line break” (v2): link
- psSaveListToFile(tmpList, tmpOutputFile, False);
- psSaveListToFile(tmpList, tmpOutputFile, True);
- We even added a third possibility where you can change the encoding and BOM of the resulting Csv file (v3): link
- https://docs.microsoft.com/nl-be/windows/win32/intl/code-page-identifiers
- psSaveTxt2File(tmpList.Text, tmpOutputFile, ‘UTF-8’, True)
- If you would need a different option, please let us know, many options are possible.
- RunTime Log Result:
#csv #managedfiletransfer #filetransfer #filemanagement
If you need any help with this ‘remove the header row’ question, please let us know.
Best Regards,
Limagito Team