Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: changing the first number of every line

by choroba (Canon)
on Nov 21, 2012 at 13:14 UTC ( #1004914=note: print w/ replies, xml ) Need Help??


in reply to changing the first number of every line

perl -i~ -p -e 's/^0/1/' *.txt
-i changes the files, backups are created with the ~ appended
-p prints each line after applying the code.
The code just replaces 0 at the beginning of a line with 1.
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: changing the first number of every line
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2015-07-05 06:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls