The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: find replace
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 01-25-2008
dbsurf dbsurf is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 23
find replace

Hi

I am replacing some string occurances with empty string in all files under one directory using

find ./ -name "*.dmp" | xargs perl -pi -e 's/\\N//g' |

its taking too much time for replacing and redirecting to same file in the same directory.

Similarly afterwards i am finding last character of each line.If last character is semicolon i am removing it.If last character is not semicolon i am appending next line to present line using
sed -e :a -e '/;$/!N;s/\n//; ta' -e 's/;$//'

But this is also taking too much time for the operation.

I am doing above operation without looping.

Can anyone have a look at it?