I've got a bunch of files (40 or so) and in each there is a substitution I need to perform.
I execuet the following sed command but it just make the changes to the screen without affecting the original file.
sed "s/, LA/,LA/g" *
(All files in the directory need this update).
So I tried... (4 Replies)
i have a command like :
sed -n 's/^* /&/w even' <file
if i want to write to multiple files like
sed -n 's/^* /&/w zero two three' < file
its not working it is taking "zero two three" as a single file i want to write to 3 seperate files . pls can anyone help me (2 Replies)
Hi,
I want to do a search and replace on multiple text files. Can I use sed to do this?
i.e. I want to do something like:
$ sed *.html -e 's/<\/body>/<\!-- blah -->\n<\/body>/' | grep -1 body
... then pipe/ channel the results back into the same files that were searched.
how would... (2 Replies)
Hi guys,
say I have a few files in a directory (58 text files or somthing)
each one contains mulitple strings that I wish to replace with other strings
so in these 58 files I'm looking for say the following strings:
JAM (replace with BUTTER)
BREAD (replace with CRACKER)
SCOOP (replace... (19 Replies)
What is the syntax to use multiple input files in a SED command. i.e. substitute a word with a phrase in every file in a directory.
for every file in /usr/include that has the word "date" in the file
grep -l '\<date\>' /usr/include/*.h
find each occurrence of the word "time" in the file &... (3 Replies)
Hi, I was hoping that someone could help me. I have a problem that i am trying to work on and it requires me to change text within multiple files using sed. I use the program to change an occurance of a word throughout different files that are being tested. At first i had to Create a new script,... (1 Reply)
Hi, I was hoping that someone could help me. I have a problem that i am trying to work on and it requires me to change text within multiple files using sed. What i have so far is
!/bin/sh
File1="$3"
File2="$4"
File3="$5"
testNum="$File1"
while test "$testNum" <= "$File3";
do
echo... (12 Replies)
I am not sure what I am doing wrong here. The code should work fine. I have been making small changes insuring that each new bit works. Now running my sed through multiple files I am getting incorrect output. Any help and instruction would be greatly appreciated.
The problem -
Generalize... (10 Replies)
I have 4000 files like
$cat clus_grp_seq10_g.phy
18 1002
anig_OJJ65951_1 ATGGTTTCGCAGCGTGATAGAGAATTGTTTAGGGATGATATTCGCTCGCGAGGAACGAAGCTCAATGCTGCCGAGCGCGAGAGTCTGCTAAGGCCATATCTGCCAGATCCGTCTGACCTTCCACGCAGGCCACTTCAGCGGCGCAAGAAGGTTCCTCG
aver_OOF92921_1 ... (1 Reply)
Created a shell script to invoke sed to edit multiple files, but am missing something.
Here's the shell script:
oracle:$ cat edit_scripts.sh
#!/bin/sh
#------------------------------------------------------------------------------
# edit_scripts.sh
#
# This script executes sed to make global... (4 Replies)