read a line from a text file
-
I have a CVS file that is too large for excel to read in. So, I want to read in the text file line by line and write out a new CVS file based on the key. What is the best way in C# to read in a line from a text file. I've looked at StreamReader, but I am thinking there is a better way. Thanks
Tom Wright tawright915@gmail.com
-
I have a CVS file that is too large for excel to read in. So, I want to read in the text file line by line and write out a new CVS file based on the key. What is the best way in C# to read in a line from a text file. I've looked at StreamReader, but I am thinking there is a better way. Thanks
Tom Wright tawright915@gmail.com
Try using TextReader.ReadLine[^] to read individual lines from the file, then String.Split[^] to get an array of the individual CSV fields. This should allow you to manipulate the data as you see fit, then you can just write the modified data back out to a new file.
-
Try using TextReader.ReadLine[^] to read individual lines from the file, then String.Split[^] to get an array of the individual CSV fields. This should allow you to manipulate the data as you see fit, then you can just write the modified data back out to a new file.
-
I have a CVS file that is too large for excel to read in. So, I want to read in the text file line by line and write out a new CVS file based on the key. What is the best way in C# to read in a line from a text file. I've looked at StreamReader, but I am thinking there is a better way. Thanks
Tom Wright tawright915@gmail.com
Depending on how complex your CSV file is..you might consider one of these solutions: 1) http://www.codeproject.com/cs/database/CsvReader.asp[^] 2) http://www.codeproject.com/cs/database/GenericParser.asp[^]