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
sabine
NA
11
0
Read attributes from text file
Mar 23 2012 7:25 AM
Hi,
I need to read lines from a .txt or .csv file (not sure yet of the extension) where the data is ';' delimited.
I will use the below code:
int counter = 0;
string line;
// Read the file and display it line by line.
System.IO.StreamReader file =
new System.IO.StreamReader("c:\\test.txt");
while((line = file.ReadLine()) != null)
{
Console.WriteLine (line);
counter++;
}
file.Close();
// Suspend the screen.
Console.ReadLine();
But what I need to know is, on each line I have 4 attributes seperates with ';' how can i read each attribute seperatly and save it in a string value?
Thank you in advance
Reply
Answers (
3
)
how can changes computer resolution in c# code (window app)
combobox keypress reject all keys