How to validate csv file?

后端 未结 4 770
感情败类
感情败类 2020-12-05 11:29

How can we validate a CSV file ?

I have an CSV file of structure:

Date;Id;Shown
15-Mar-10;231;345
15-Mar-10;232;346
and so on and on !!! approx arou         


        
4条回答
  •  攒了一身酷
    2020-12-05 12:21

    You could used a regular expression to find rows that match (and therefore flag the ones that don't). Have a look at this link. That being said, you'll need to read through the whole file in order to validate it so you're probably better off just trying to parse it the first time through and catching any errors.

提交回复
热议问题