05-13-2010
Find and replace issue
Hello Guys
i am seeking help here is my issue
I have several files i need to find "&" char and replcae with & or '
1) It may be possible that in a file there are several occurance of &, & or '
but need to replace only & whihc does not have amp; and apos;
2)it may be the case out of 5 4 have & and one is only & so in that case need to replace last one with &
Please help.
Thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Iam new to shell script.How to write bourn shell script for find and replace.
My requirement is:
variable:
name="abcd & co"
i wanted to replace '&' with amp; plz suggest with out using sed.
Thanks lot. (2 Replies)
Discussion started by: ram2s2001
2 Replies
2. UNIX for Dummies Questions & Answers
I have no idea really what I am doing but I am very good at copy-paste code from smart people :)
I found it a while back but can't get it now, I am looking for a simple command line prompt command to search and replace text in multiple files.
I have a website with a ton of pages and all links... (6 Replies)
Discussion started by: scavok
6 Replies
3. UNIX for Dummies Questions & Answers
After running a command like
grep -ir files2/ *
This will find all the files that contain "files2/" in it.
For example if it finds
files2/dir/today
files2/dir/yesterday
files2/dir/2daysago
Now it may find 100 instances, so is there a quick find and replace command I can use? I... (4 Replies)
Discussion started by: NycUnxer
4 Replies
4. Shell Programming and Scripting
I have the following problem:
I have two files: S containing sentences (one in each row) and W containing files (one in each row). It might look like this:
S:
a b c apple d.
e f orange g.
h banana i j.
W:
orange
banana
apple
My task is to replace in S all words that appear in W... (2 Replies)
Discussion started by: tootles564
2 Replies
5. Shell Programming and Scripting
Hi All,
point 1. I have n number of environment variable files in different folders. All file names are ending with one thing common ie, *envset.sh
point 2. All these contains Varilables and some other information like following
*envset.sh ===>>
... (3 Replies)
Discussion started by: nitin.pathak
3 Replies
6. Shell Programming and Scripting
Hello,
Although I have found similar questions, I could not find
advice that could help with my problem. The issue:
I am trying to replace all occurrences of a regex, but
I cannot make the regex groups work together.
This is a simple input test file:
The Vedanta Philosophy... (3 Replies)
Discussion started by: samask
3 Replies
7. Shell Programming and Scripting
Hi,
I have the below data in a file in one of the path,
101 02100002111406893401207310900A094101xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
5200xxxxxxxxxx D18000_1 CCDXXXXXXX JUL 31201207 1140689340000001
622113010547999999999003 000333333334RE ... (1 Reply)
Discussion started by: Ramyajiguru1
1 Replies
8. Shell Programming and Scripting
Hi Experts..
I have requirement in which I have a text file say a.txt which looks like below:
ASD
1
2
3
4
5
ASD
9
8
7
6
5
ASD
1
2
3 (5 Replies)
Discussion started by: Sathya83aa
5 Replies
9. Programming
Hi,
I have a problem with a replace of a pattern in a file.
Example of file:
CREATE TABLE TEST.TEST
(
ID_SOGGETTO BIGINT NOT NULL,
ENTE VARCHAR(64))
UNIQUE PRIMARY INDEX ( ID_SOGGETTO ,ENTE );
I want to replace the red pattern with another text:
i want to replace the text after the... (6 Replies)
Discussion started by: mgazzato
6 Replies
10. Shell Programming and Scripting
I have a file change.sed
more change.sed
I fire the below command inorder to replace "190.169.11.15" with "10.4.112.240" in proxy.logsed -f change.sed proxy.log proxy.log has the below entry
more proxy.log
The command replaces both 190.169.11.15 & 190.169.11.155 as below:
I am expecting... (17 Replies)
Discussion started by: mohtashims
17 Replies