Re: Bests way to handle lines in files with only a return character?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: Bests way to handle lines in files with only a return character?

From: Gerald W. Lester <Gerald.Lester@cox.net>
Date: Thu Dec 29 2005 - 18:26:14 CET

Keith wrote:
> I am running into a problem with lines in a file
> I am retrieving that only have a return character in them.
> What is the best way to detect lines with only that character
> in them?
> Example
> 123.456780
> 123.567890
>
> 123.999999
> 123.888888
>
> 123.777777
>
> TIA,
>

If you are using gets, as in:
      set count [gets $inFile line]
then test for count to be equal to 0 or for [string equal $line {}] to be true.
Received on Tue Jan 3 03:09:37 2006