Re: What is the best way to handle a missing newline in the following case

2010-11-05 Thread Neil Cerutti
On 2010-11-05, Paul Rudin wrote: > "danmcle...@yahoo.com" writes: >>> The problem is when I get to the last line. When the program >>> sees '\n' after the 9, everything works fine. However, when >>> there isn't a '\n', the program doesn't process the last >>> line. >>> >>> What would be the best

Re: What is the best way to handle a missing newline in the following case

2010-11-05 Thread Paul Rudin
"danmcle...@yahoo.com" writes: >> The problem is when I get to the last line. When the program sees '\n' >> after the 9, everything works fine. However, when there isn't a '\n', >> the program doesn't process the last line. >> >> What would be the best approach to handle the case of the possible

Re: What is the best way to handle a missing newline in the following case

2010-11-05 Thread danmcle...@yahoo.com
> The problem is when I get to the last line. When the program sees '\n' > after the 9, everything works fine. However, when there isn't a '\n', > the program doesn't process the last line. > > What would be the best approach to handle the case of the possible > missing '\n' at the end of the file?

Re: What is the best way to handle a missing newline in the following case

2010-11-05 Thread Peter Otten
chad wrote: > I have an text file with the following numbers > > 1 > 3 > 5 > 7 > 3 > 9 > > > > Now the program reads in this file. When it encounters a '\n', it will > do some stuff and then move to the next line. For example, it will > read 1 and then '\n'. When it sees '\n', it will do some

What is the best way to handle a missing newline in the following case

2010-11-05 Thread chad
I have an text file with the following numbers 1 3 5 7 3 9 Now the program reads in this file. When it encounters a '\n', it will do some stuff and then move to the next line. For example, it will read 1 and then '\n'. When it sees '\n', it will do some stuff and go on to read 3. The problem i