1754021 Members
6904 Online
108811 Solutions
New Discussion юеВ

Need Help

 
SOLVED
Go to solution
Allanm
Super Advisor

Need Help


I have a file which has line numbers in front of it and I need to remove them... how do I do that ?

1 use strict;
2 use warnings;
3 use File::Find;
4 use Digest::MD5;


Thanks,
Allan.
2 REPLIES 2
James R. Ferguson
Acclaimed Contributor
Solution

Re: Need Help

Hi Allan:

In keeping with the Perl contents of your file, do:

# perl -pi.old -e 's/^\d+\s+//' file

...which makes a backup with the ".old" extension and eliminates leading digits and whitespace.

Regards!

...JRF...
Allanm
Super Advisor

Re: Need Help

Thanks!