The UNIX and Linux Forums  


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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
find and replace javeed7 Shell Programming and Scripting 1 04-02-2008 10:00 AM
find and replace mahabunta UNIX for Dummies Questions & Answers 7 09-21-2006 01:05 PM
find and replace valhutch UNIX for Dummies Questions & Answers 4 07-29-2006 06:20 PM
find and replace vikas_j@hotmail UNIX for Dummies Questions & Answers 3 02-25-2002 05:41 PM
Find & Replace gagansharma Shell Programming and Scripting 3 11-27-2001 04:17 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #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?
  #2 (permalink)  
Old 01-25-2008
Yogesh Sawant's Avatar
Yogesh Sawant Yogesh Sawant is offline Forum Staff  
Part Time Moderator and Full Time Dad
  
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 1,086
does this directory contain a thousand *.dmp files?
  #3 (permalink)  
Old 01-25-2008
dbsurf dbsurf is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 23
Yes it contains thousand.dmp files
Closed Thread

Bookmarks

Tags
find, xargs

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:20 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0