Split delimited files based on duplicate column
Q: We receive | (pipe) delimited files (no double quotes):
Rvman International Inc. – US|CONTENT + US|1310001|0000000122|10/25/
Rvman International Inc. – US|CONTENT + US|1310002|0000000616|0/25/2023 2:10 PM
Rvman International Inc. – US|CONTENT + US|1310002|0000000616|0/25/2023 2:10 PM
Is it possible to create separate files of rows with the same content in column 4?
The filename(s) would be incremental:
original .csv
Rvman International Inc. – US|CONTENT + US|1310001|0000000122|10/25/
original1.csv
Rvman International Inc. – US|CONTENT + US|1310002|0000000616|0/25/2023 2:10 PM
Rvman International Inc. – US|CONTENT + US|1310002|0000000616|0/25/2023 2:10 PM
Thanks for such a great product!
A: Yes this is possible using our Pascal Script option
We used a Windows folder as Source. In this folder we’ll search for .csv files.
Since we are only interested in .csv files we added a filename include filter. We want to be sure we’ll only handle .csv files.
As Destination we used our Pascal Script option. Please replace the default Destination Pascal Script.
You can download the script: here
The script will read the csv file with a pipe as delimiter (this can be adjusted > ctPipe constant). We’ll check the content of column 4 which is index 3 (TStringList = zero index based).
tmpCol4 := tmpPipe.Strings[3];
Output Result:
RunTime Log Result:
#csv #managedfiletransfer #filetransfer #filemanagement
If you need any help with this ‘Split delimited files based on duplicate column’ question, please let us know.
Best Regards,
Limagito Team