Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

all inclusive replacement

Status
Not open for further replies.

segment

ISP
Jun 15, 2004
225
US
Hey all. I have 4500+ files all close to being the same. I'm trying to do an inplace edit for one variable but I can't seem to finesse it...

I have the following line inside every file

238 SOMETHING email:somewhere@someplace.com MAIL/4.2\r

The number 238 is always changing and I need to remove those numbers altogether to leave:

SOMETHING email:somewhere@someplace.com MAIL/4.2\r

Most of the changes I've made using awk, sed and perl (perl -pi -e 's/something/something else/g') but I can't find a way around this one... Remember the numbers change so in on instance it may be:

238 SOMETHING email:somewhere@someplace.com MAIL4.2\r

The next it may be:

1444 SOMETHING email:somewhere@someplace.com MAIL4.2\r

Any thoughts in this?

perl -e 'print $i=pack(c5,(40*2),sqrt(7600),(unpack(c,Q)-3+1+3+3-7),oct(104),10,oct(101));'
 
This Works:
Code:
perl -pi -e 's/^\d+\s+(SOMETHING.*)/$1/g'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top