Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Reading text file with <CR> line endings

by Marshall (Canon)
on Mar 02, 2018 at 18:44 UTC ( [id://1210244]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1210244]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (7)
As of 2024-04-24 09:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found