The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-30-2009
Gussifinknottle Gussifinknottle is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 20
Question remove characters from line

Hello,

I have multiple lines in a file, each of which will have data that looks like this:

xxxxxyyyyzzzz4abcdXYZXYZXYZ
pqrstPQRST2cdPQRSTPQRST
lmnopqr6abcdefgRST.3abc

I want to be able to remove the number 4 + the following 4 characters (abcd) in the first line.

For the second line, I want to be able to remove 2 + the following 2 characters (cd)

Basically, remove the number and the number of characters matching the number removed.

Any suggestions?

Thanks,
G.