Dear Wise Monks,
I'm trying to parse and validate text file content. For the first line and last line alone validation will be different.
I am using following code to find the last line of the file.
open(FILE, "< $file") or die "can't open $file: $!"; $count++ while <FILE>; # $count now holds the number of lines read open(FILE, "< $file") or die "can't open $file: $!"; for ($i=0; <FILE>; $i++) { if ($i == $count) { # Validate last line } }
In reply to Find last line in Text file parsing by selva
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |