TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Gustavo
NA
1.3k
454.3k
How do I: ReadLine and split columns?
Feb 28 2010 3:22 PM
Hello:
I do a ReadLine on a text file and I need to split out the columns so I can populate a dataGrid. The data uses comma seperators. Reason I am not using Jet or ODBC is because it seems these two do not work on x64.
Below is my code, for now:
{
String
line;
//Pass the file path and file name to the StreamReader constructor
StreamReader
sr =
new
StreamReader
(
"C:\\Test.txt"
);
//Read the first line of text
line = sr.ReadLine();
//Continue to read until you reach end of file
while
(line !=
null
)
{
//write the lie to console window
Console
.WriteLine(line);
//Read the next line
line = sr.ReadLine();
// Column1 = ____;
//Column2 = ____;
}
//close the file
sr.Close();
Console
.ReadLine();
}
Reply
Answers (
4
)
HOW TO GENERATE A STRONG PASSWRD?
How do I: Format c# code?