Hi guys,

im yet again having a problem with a task! im struggling to get my head around stream reader.

ive managed to grasp the basics how to read and write to .txt files when entrys are a new line in the .txt file

( i.e the .txt file layout is . .
string 1
string 2
double 1
string 2
string 3
double 2
)

but im having trouble reading in .txt files with the data all on the same line of the .txt file

i.e
(string 1, string 2, double1
string 2, string3, double 2)

i basically need to check the users inputs match string1 and string2 and then get the value of double1 to preform an algorythm.

any help or ideas to point me in the right direction will help me loads :)

thanks in advance

Look at: http://www.daniweb.com/forums/thread176597.html

It has an example of converting the contents of the file to integers based on line number. You can use that concept to test each line for the respective data type.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.