find and replace! Urgent


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting find and replace! Urgent
# 8  
Old 03-06-2009
sed -e '/startwork-expr/,/endwork-expr/s/find-expr/replace-expr/' file

by using this method SED will start working when it finds PAYMENT and will stop working when it finds ConversionPattern then it will replace what you find on the line containing ConversionPattern.
# 9  
Old 03-09-2009
Thanks. It worked!
# 10  
Old 03-10-2009
Code:
#!/usr/bin/perl
open FH,"<a.txt";
$/="\n\n";
while(<FH>){
	s/^(.*name="PAYMENTLOG".*)(%c{1})(.*$)/$1%p,$2$3/s;
	print $_;
}

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Urgent: please replace the perl script in the post with following code

Hi This is very urgent as it is confidential info posted by mistake.Kindly help us asap. post link below: https://www.unix.com/shell-programming-and-scripting/201037-perl-while-loop-each.html please replace the perl script with following script in the post ... (1 Reply)
Discussion started by: ptappeta
1 Replies

2. Shell Programming and Scripting

Problem with Find command urgent help!!

hi I used find command to find some file names as per input from user. I used it for current directory. It was working fine. Now I tried with giving some other directory path. Its giving issues. Here what I tried. Script will take input from user say 1_abc.txt, find the file and print list. if... (1 Reply)
Discussion started by: sukhdip
1 Replies

3. Shell Programming and Scripting

replace a string in perl - Urgent

Hi, Can anyone help me to replace ='is NOT NULL' to is NOT NULL in perl. I tried all the methods which i know, i didnt arrive at the solution. please help!! ---------- Post updated at 03:01 PM ---------- Previous update was at 02:56 PM ---------- I got it.......! Thanks, (1 Reply)
Discussion started by: jam_prasanna
1 Replies

4. Shell Programming and Scripting

Urgent help needed !!!....to replace a exact string

Hi experts, As i am a novice unix player...so need help for the below query...banged my head from quite a while...:confused: i have a set of html files, in which i need to search for string "Page"(case sensitive) and then replace the same with some numeric code ,say, "XXX1234". Here in... (1 Reply)
Discussion started by: rahulfhp
1 Replies

5. UNIX for Dummies Questions & Answers

very urgent..need of a script which finds a file without the use of find command..hlp

im a beginner in shell scripting and i need a script which will find a file in a given path without the use of find or grep command.......i need some kind of code.....plzzz plzzzz help me......ive tried n searched every where but i couldn't find the solution for my particular problem..... (4 Replies)
Discussion started by: mishi
4 Replies

6. Shell Programming and Scripting

Urgent: find some strings in all the tables

Hi ,, I want to write a shell script to search following strings values in columns of all the tables in the database: BO_OPSWAP,BOOPSWAP FO_OPSWAP,FOOPSWAP, OPSWP not swapwire please help on this.. it's quite urgent....... i 'm working on UNIX AIX servers....and using sqlplus... (1 Reply)
Discussion started by: unknown123
1 Replies

7. UNIX for Advanced & Expert Users

urgent: problem with find command

find / * -print > /var/tmp/updatedfilelist.txt 2>&1 i need to run the above file in cron. problem is, this process takes a long long long time to finish up. and even worse, it fills up the directory the output file is located in. i dont want the /var directory to ge filled up because of... (10 Replies)
Discussion started by: Terrible
10 Replies

8. HP-UX

URGENT: UNIX FTP cannot find path error

Dear all We are currently working on to install some ERP system in wjhich we need to FTP from unix to windows 2000 machine We run ./lodrun to get files from d/xxxxx/xxxx directory but the ftpoutput.log file shows following error FTP: xxxxxxxxx system cannot find the path specified... (1 Reply)
Discussion started by: minix
1 Replies

9. UNIX for Dummies Questions & Answers

find command - Urgent Plz.

Hi, In my current directory, i have the following files: x1.dat x2.dat.gz x3.dat I want to use the find command and display only files which has *.dat and NOT *.gz extension files. Please help me out. Thanks, Kris Kart. (2 Replies)
Discussion started by: Kris_Kart_101
2 Replies

10. UNIX for Advanced & Expert Users

help on find with chmod.. urgent help needed

Hello to all Unix gurus.. I am writing a generic script which takes the options of unix command as input and concatenate all the pieces and forms a complete executable command. I am getting an error with the following command as I am resetting my own permission on the root directory. When the... (4 Replies)
Discussion started by: sdlayeeq
4 Replies
Login or Register to Ask a Question