fly412s
asked on
Cleaning a file for use as a flat file database
I have a comma deliminated text file (.csv) I have to use in a program. The first two rows in the file are blank. The actual field names (column headers) begin in the 3rd row. What is the best way to delete those first two rows. Is there a way to have the person using the program select the row in which the field titles begin and then delete up to that row and reload the file into the database?
Thanks.
Thanks.
ASKER
I might be able to use XML. I won't know until this Friday, the 13th of May. I'll be traveling up to my client the end of this week. I'll check their systems capabilities.
Thank-you,
Tom
Thank-you,
Tom
If you are using a StreamReader, you can simply call ReadLine x number of times without doing anything with the result. x can either be hardcoded or an value that the user supplies. Then do something with the remaining lines.
ASKER
I agree, however, I was looking for a more elegant way such as presenting the file in its entirety via a datagrid or something similar. Then allowing the user to select the row with the names of the fields (or column headers). The issue is hardcoding a value and then the structure of the file might change.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Bob