This looks promising, except the files I need to work on (e.g. somefile) are not delimited, they are free form database configuration files (see what my ggrep returns on an example file).
I can make my own pwds file (with my own delimiter in case : is used in a password) - but unless my somefile files are delimited (and they are not, they are free form), this doesn't appear to work for me.
Hi there,
I am using AIX and trying to search and replace a string with another string in multiple files in different directories.
I wanted to search replace in steps so I don't change all of the instance anywhere in the server at once, minimizing impact.
STEP 1:
--------
I first searched... (5 Replies)
I have a environment property file which contains:
Input file:
value1 = url1
value2 = url2
value3 = url3 and so on.
I need to search all *.xml files under directory for value1 and replace it with url1.
Same thing I have to do for all values mentioned in input file. I need script in unix bash... (7 Replies)
Hello,
I have hundreds of files in which I need to change email address. Here is what I am trying to do:
1. All text files are in a directory "a"
2. In the text file, I want to replace email address for preparer. All these lines start with {{PreparerEmail and end with }}. The email... (3 Replies)
When I use special characters the command to replace multiple files with a string pattern does nt work.
---------- Post updated at 12:33 PM ---------- Previous update was at 11:38 AM ----------
This works
perl -pi -e 's/100/test/g' *
This does nt work
perl -pi -e 's... (1 Reply)
Hey guys. I know pratically 0 about Linux, so could anyone please give me instructions on how to accomplish this ?
The distro is RedHat 4.1.2 and i need to find and replace a multiple lines string in several php files across subdirectories.
So lets say im at root/dir1/dir2/ , when i execute... (12 Replies)
Hi all.
I have the following command that is successfully searching for any one of the strings on all lines of a file and replacing it with the instructed value.
cat inputFile | awk '{gsub(/aaa|bbb|ccc|ddd/,"1234")}1' > outputFile
This does in fact replace any occurrence of aaa, bbb,... (2 Replies)
Hi All,
Iam new to unix, I need to find string and replace it in the file name. Like
text_123_0.txt,text_123_1.txt,text_123_2.txt. I need to search 123 and replace it with 234 . Is there any unix command to replace them in single command since i have 5 directories. So i need to go each and every... (0 Replies)
Hi all
I'm in need of a command which can replace a specified string with another string - across multiple files within multiple sub-directories (I intend to run it from / )
I've used the following to get a list of the files:
find . | xargs grep <string1>
But that's as far as I've got.... (7 Replies)
Hi,
I have a folder which contains multiple config.xml files and one input file, Please see the below format.
Config Files format looks like :-
Code:
<application name="SAMPLE-ARCHIVE">
<NVPairs name="Global Variables">
<NameValuePair>
... (0 Replies)
find . -type f -name "*.sql" -print|xargs perl -i -pe 's/pattern/replaced/g'
this is simple logic to find and replace in multiple files & folders
Hope this helps.
Thanks
Zaheer (0 Replies)