In the .csv file there are 4 columns, you only need to read the information from the first column. While I see the solution only through regular expressions.
Tell me, maybe there is a simpler way?
In the .csv file there are 4 columns, you only need to read the information from the first column. While I see the solution only through regular expressions.
Tell me, maybe there is a simpler way?
If you break a string with commas and save only the first column:
List<string> parsed = new List<string>(); using (StreamReader reader = new StreamReader("...")) { string row; while ((row = reader.ReadLine()) != null) { parsed.Add(row.Split(',')[0]); } }
At least two solutions:
Source: https://ru.stackoverflow.com/questions/11300/
All Articles