Thread: parse file q
View Single Post
Old 08-30-2003, 02:10 AM  
w3rd
Junior Member
 
Join Date: Aug 2003
Posts: 12
Question parse file q

hey,

i'm trying to parse a file in c++ using strtok() but for some reason i end up with more then just one line in the read buffer...

(i'm using fopen to open the file and fgets to read the buffer)

i tried parsing out the '\n' '\r' and '\0' but still having problems with unnecessary lines in the result.. i need to seperate each line read from the file in some way. another problem i'm having is that if i do this, and there is no \n char at the end (no new line was added, or enter wasnt hit) i get stuck with it saying there are no lines in the file :/ any suggestions?



thanks in advance, w3rd
w3rd is offline