Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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

by Laurent_R (Canon)
on May 17, 2019 at 17:59 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2023-03-24 19:52 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (61 votes). Check out past polls.