Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: how to get length of each line of file with spaces

by Laurent_R (Canon)
on May 17, 2019 at 17:59 UTC ( [id://11100198]=note: print w/replies, xml ) Need Help??


in reply to how to get length of each line of file with spaces

You've been given some good solutions already, and my guess is that if you use a regex substitution (s/\t/    /g) or the tr//: transliteration operator, you probably no longer need to keep track of the line number. But if you need to track the line number for some other reason, please be advised that the $. special variable does that automatically for you (it reports the current input line number of the last file handle that was read).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2024-03-29 12:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found