|
Posted by Alvaro G. Vicario on 08/29/06 21:21
*** Patrick escribió/wrote (Tue, 29 Aug 2006 16:06:00 -0400):
> Can someone take a look at my script and tell me if I am missing
> something as to why the last line of data from my input file is being
> written twice in the echo. I have included a short sample of the data
> and the script.
I'd say it's because of the trailing line endings in the data file. If you
add more line endings, you get more duplicate lines.
You never reset the variables you use in sscanf() so for every line where
expected input is not found, the keep their previous value.
--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--
Navigation:
[Reply to this message]
|