Alex Rivera | Logout

Perl regex to act on a file from the command line

Asked 2010-12-05T20:35:43.920
9

In a file, say xyz.txt i want to replace the pattern of any number followed by a dot example:1.,2.,10.,11. etc.. with a whitespace. How to compose a perl command on the command line to act on the file to do the above, what should be the regex to be used ?

Please Help Thank You.

Edit
Report

1 Answer

1

Both

perl -ipe "s/\d+\./ /g" xyz.txt

and

perl -pie

cannot execute on my system.

I use the following order:

perl -i -pe
answered 2010-12-06T01:23:33.777

Your Answer