Best way to remove the Header from a CSV file.

David_SingletonDavid_Singleton Member Posts: 5,479
Just wondering what you guys prefer to do this.

I have "pseudo" csv file, that has the column names as headers. Currently I have a working dataport if I remove the headers manually. So I don't really want to rewrite the whole thing in code.

Option 1/ and the most obvious solution is just to have the user manually delete the header, the problem is that the file has a .CSV extension, so at some stage they are going to double click it, open it in excel, delete the first row, save it (some how) and then ruin the file. So option one out.

The other four options are

2/ My preferred option would be to convert the file to XML and be done with this horrid antiquated CSV nonsense.

3/ Hack the Dataport with an additional dataitem, and change the <<NewLine><NewLine>> itme seperator to something that is constant at the end of the header line.

4/ Read the file in CAL and rewrite back without the header.

5/ Call an external script to do it.

So out of curiosity what do most people prefer.
David Singleton

Comments

Sign In or Register to comment.