Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validate a CSV File ?

Status
Not open for further replies.

rwaldron

MIS
Aug 6, 2002
53
IE
Hi all,

I need to validate some CSV files.They exist in a local folder and can have any name. eg: eir102.csv, eir103.csv

I want to check for any csv files in a folder and validate..IF Validation ok then save to good folder IF Fail then save to bad folder.

Anyone know a good example of reading a csv file and then checking that the file is in the correct format:

Will I need to convert to XML,compare to XML Template then save as CSV again ?

I have looked this up and using streamreader/writer and regex may be what I need to use but I need a good example.

eg: (1) check fields lengths between commas are of a certain length

(2)check comma count .ie: that the csv contains the correct amount of fields (whether empty or not )



Please point me in the right direction.

Ray..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top