The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
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 08-09-2007
gopalss gopalss is offline
Registered User
  
 

Join Date: May 2007
Posts: 3
find and replace pattren in file

Hi,

I have the input file having data as follow:
file1.txt
001 aaa_1:abcd
002 bbb_2:abcd

I want output as,
001xabcd
002xabcd

Here iam trying to replace "{1 space}{alphanumeric string with underscore}{:}" with characrter "x".
I tried to achieve this using sed;but Iam not getting this correctly.

Thanks in advance.