in reply to Re: Reading text file with <CR> line endings
in thread Reading text file with <CR> line endings

I've got a bit of an issue because in my fiddling with this thing, I over-wrote the file. I can get it back and try chomp(), but my regex should be even better? Here is more of the actual code... #lines were used in my testing...
while (my $line = <IN>) { # print "line=$line\n"; next if $line =~/^\s*\w+:/; # The Run_Time: line next if $line =~/^\s*$/; # A blank line $line =~ s/\s*$//; # No trailing spaces or line ending $line =~ s/^\s*//; # No leading space next if $line =~ /^Call/; # Skip the CSV header line my($call,$bracket) = (split /\|/,$line)[0,-1]; # print "$call, $bracket\n"; #### nothing printed here either # more processing ... not shown.. }

Replies are listed 'Best First'.
Re^3: Reading text file with <CR> line endings
by LanX (Saint) on Mar 02, 2018 at 18:46 UTC