Skip to main content
Hi,

 

 

I have two CSV files which I want to merge.

 

 

File A has two lines.

 

 

File B is much larger and has many lines, preceded by a header.

 

 

Effectively what I want to do is create File C from a copy of File A with File B (minus it's header) appended onto it. I don't want to alter the data in any way.

 

 

thanks

 

 

IanM
Hi,

 

 

first of all, I'd recommend using the Text File reader/writer rather than the CSV reader/writer for this.

 

 

Then look into the Sampler to skip the header of file B. Also insert a FeatureHolder on the features from file B to prevent them from being written before all the lines from file A have been passed to the writer.

 

 

David
Or select relevant rows.

 

Renumber, sort and write.

 

 

Using "csv_line_number" exposed
Thanks, that's pretty much what I'm doing at the moment but the TEXT reader doesn't like a filename with .CSV so it's a little faffy ... get files, rename offline, run workspace, rename output offline

 

 

 

IanM
I believe the Text File reader can read any text file regardless of the extension. Try changing the filter of the Select File dialog into "All Files (*.*)".
Great. Thanks.

Reply