Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Adding a TAB after a certain ammount of characters

by kennethk (Abbot)
on Apr 16, 2013 at 20:33 UTC ( #1029007=note: print w/replies, xml ) Need Help??

in reply to Adding a TAB after a certain ammount of characters

xkcd://208: Regular Expressions to the rescue.
perl -pi -e 's/^(.{17})(.{6})(.{31})(.{3})(.{3})/$1\t$2\t$3\t$4\t$5\t/ +' file.txt

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1029007]
Corion munches on the traditional German winter fruit, strawberries. Imported from Spain at the price of EUR 0.77 per 150g - not really cheap but surprisingly good for a winter produce
Discipulus straberries portable edition

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2017-01-20 10:23 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (174 votes). Check out past polls.