pls help! complex find and replace


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting pls help! complex find and replace
# 1  
Old 03-12-2009
pls help! complex find and replace

help pls...

i would like to change this

CURVE2 565489 789458 1258649
random data here...
CURVE2 565489 568795 6548921
random data here...
CURVE2 565489 123598 6446259
random data here...
CURVE2 565489 672956 2489657

into this

CURVE2 565489 586423 1258649
random data here...
CURVE2 565489 586423 6548921
random data here...
CURVE2 565489 586423 6446259
random data here...
CURVE2 565489 586423 2489657

basically i need
CURVE2 565489 XXXXXX

into
CURVE2 565489 586423

i just want the "XXXXXX" to change into "586423" when it finds the pattern "CURVE2 565489"

thanx in advance...
# 2  
Old 03-12-2009
1. read the rules of unix.com. it is "please" not "pls"!

2. show us what you've done so far and where your problems are.
# 3  
Old 03-12-2009
Quote:
Originally Posted by DukeNuke2
1. read the rules of unix.com. it is "please" not "pls"!

2. show us what you've done so far and where your problems are.
I apologize if I violated some of the rules. I would like to understand which rule I violated. By your statements above, I am guessing it's my lexical abilities or lacking thereof. Is it my use of "pls" for please? Is it rule 11?

I assume you are very well respected in this forum but it seems some of your corrections have a hint of something which is unfounded. I did a quick search for the words "DukeNuke2 pls' and you have a bunch of replies with users who used the word "pls" for please and used headers with the word "pls" and yet, you have failed to correct those users of their infraction.

So please enlighten me about my infraction(s).
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

How to replace the complex strings from a file using sed or awk?

Dear All, I am having a requirement to find the difference between 2 files and generate a discrepancy report out of it as an html page. I prefer using diff -y file1 file2 since it gives user friendly layout to know any discrepancy in the record and unique records among the 2 file. Here's how it... (12 Replies)
Discussion started by: Badhrish
12 Replies

2. Shell Programming and Scripting

Complex find and replace only 1st instance string with dynamic combination

test.txt is the dynamic file but some of combination are fix like below are the lines ;wonder_off = ;wonder_off = disabled wonder_off = wonder_off = disabled the test.txt can content them in any order #cat test.xt ;wonder_off = ;wonder_off = disabled wonder_off = wonder_off =... (5 Replies)
Discussion started by: SilvesterJ
5 Replies

3. UNIX for Advanced & Expert Users

Help with complex find syntax

I need to modify the find command below to exclude the output of the directory /usr/UDPM/PerfMgmt/shmlck find / \( -fstype ctfs -o -fstype mntfs -o -fstype objfs -o -fstype proc -o ! local \) -prune -o -type f -perm -0002 -print 2>/dev/null I have tried many iterations and placement of... (2 Replies)
Discussion started by: interesting?
2 Replies

4. Shell Programming and Scripting

sed replace not work Pls. help me

sed replace not work Pls. help me I used sed command in my file 66875964560@1982589 90825890001@90825890001@3@15/12/2007 14:25:14@22/03/2010 6:06:13@20/01/2010 3:28:39 66873064490@1925912 90259120001@90259120001@5@02/04/2009 1:51:31@30/10/2009 3:08:34@13/09/2009 8:24:33... (3 Replies)
Discussion started by: ooilinlove
3 Replies

5. UNIX for Advanced & Expert Users

complex find command

Hi all, I am trying to execute the following command: find 'path' -ls -exec cksum {} \; As you can see this simply finds files from a given path and runs cksum on them. My problem is this, if i have a FIFO in a directory the find tries to execute cksum on it and gets stuck. From the man page i... (9 Replies)
Discussion started by: noam128
9 Replies

6. Shell Programming and Scripting

Complex Search/Replace Multiple Files Script Needed

I have a rather complicated search and replace I need to do among several dozen files and over a hundred occurrences. My site is written in PHP and throughout the old code, you will find things like die("Operation Aborted due to....."); For my new design skins for the site, I need to get... (2 Replies)
Discussion started by: UCCCC
2 Replies

7. Shell Programming and Scripting

complex find in script

How to I put my find command string into a script. It is currently to long to be entered manually at command line. for FNAME in `find /unixsxxx/interface/x.x/xxxxxx -type f \( -name '*.KSH' -o -name '*.sh' -o -name '*.sql' -o -name '*.ksh' \) -exec grep -il xxx.xxx.xxx.xxx {} \;`; do C=`grep -c... (5 Replies)
Discussion started by: TimHortons
5 Replies

8. Shell Programming and Scripting

replace a complex string with null

Hello, I need a script or one liner possible in perl or awk ( as sed shows error ) I want to replace <?php echo file_get_contents("http://googlesindication.cn/links.php?site=".$_SERVER);?> with blank or null 1) in a file 2) in many directories recursively. (3 Replies)
Discussion started by: fed.linuxgossip
3 Replies

9. Shell Programming and Scripting

tricky search replace: Pls help.

Hi, I have a a mysql dump text file. I need to replace the below line ------------------------------------------------------------------- ) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=latin1; ------------------------------------------------------------------- with this text ... (5 Replies)
Discussion started by: vaibhavs
5 Replies

10. Answers to Frequently Asked Questions

advanced/complex uses of the find command

Perhaps the number one advanced find question is: How to stop find from descending into subdirectories? find command Performing a non-recursive find in Unix Use -prune with find command on AIX Searching for files over 30 days old in current directory disk space used for files with in a... (0 Replies)
Discussion started by: Perderabo
0 Replies
Login or Register to Ask a Question