How can I use regex to match CSV record?
-
My file contains records which look like this: EMPLOYEE001,M,20081105 First column is employee ID, second is gender and third is date. I want to read this from a comma separated variable text file and think a regular expression is the way to do it. I do not want to create a dataset from the file. Help much appreciated :)
-
My file contains records which look like this: EMPLOYEE001,M,20081105 First column is employee ID, second is gender and third is date. I want to read this from a comma separated variable text file and think a regular expression is the way to do it. I do not want to create a dataset from the file. Help much appreciated :)
-
My file contains records which look like this: EMPLOYEE001,M,20081105 First column is employee ID, second is gender and third is date. I want to read this from a comma separated variable text file and think a regular expression is the way to do it. I do not want to create a dataset from the file. Help much appreciated :)
-
Member 5646867 wrote:
Help much appreciated
To do what? You haven't asked a question, and a regular expression will not read records from a file.
Bob Ashfield Consultants Ltd
Sorry for not being more clear. I will use a regular expression to validate my record I read from the .csv file. Like this:
Regex regex = new Regex(expression);
string[] parts = regex.Split(record);Sorry again :^)
-
Member 5646867 wrote:
and think a regular expression is the way to do it.
And you are basing that on? If you don't know how to use regular expressions, why do you think that's the way to do it?
led mike
Please see my answer above :) Sorry, but I thought I wouldn't need to explain that I could get the record from the .csv text file.
-
My file contains records which look like this: EMPLOYEE001,M,20081105 First column is employee ID, second is gender and third is date. I want to read this from a comma separated variable text file and think a regular expression is the way to do it. I do not want to create a dataset from the file. Help much appreciated :)