10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
how to search and replace string in column in file with command sed or other
search "INC0000003.in" and replace column 4 = "W"
$ cat file.txt
INC0000001.in|20150120|Y|N|N
INC0000002.in|20150120|Y|N|N
INC0000003.in|20150120|Y|N|N
INC0000004.in|20150120|Y|N|Noutput... (4 Replies)
Discussion started by: ppmanja3
4 Replies
2. Shell Programming and Scripting
Hi guys, thanks for accepting me in your forum .. I am trying to clean some hacked PHP files using SSH .. I am using this command:
find . -type f -print0 | xargs -0 sed -i '/god_mod/d'
<?php ... (3 Replies)
Discussion started by: wisam74us
3 Replies
3. UNIX for Dummies Questions & Answers
Hello -
I have a very large file in which a certain numbers are repeated. I find that using vi to edit the entire file is useless.
How should i use sed to find a replace such as this text:
To replace: 145.D25.D558
With: 215.22.45.DW
I tried this command:
sed... (4 Replies)
Discussion started by: DallasT
4 Replies
4. Shell Programming and Scripting
hi,
im new for sed, anyone can help me to these in sed command
my output file.txt
"aaa",a1,bbb
"ddd",a1,ccc
"eee",a1,www
need to change a1, to "a1","
output i need
"aaa","a1","bbb
"ddd","a1","ccc
"eee","a1","www
thanks in advance
fsp (2 Replies)
Discussion started by: fspalero
2 Replies
5. UNIX for Dummies Questions & Answers
Hello,
I have a file and in that, I want to search for a aprticular word and then replace another word in the same line with something else.
Example: In file abc.txt, there is a line
<host oa_var="s_hostname">test</host>
I want to search with s_hostname text and then replace test with... (2 Replies)
Discussion started by: sshah1001
2 Replies
6. UNIX for Dummies Questions & Answers
Hi
I am very new to linux and scripting.
I need to replace numbers abc with number xyz inputting from a reference file.
I used the following command -
sed "s/$grd/$lab/" , where $grd and $lab comes from reference file.
The problem is the above line doesnt take care of space..... (1 Reply)
Discussion started by: ajayh
1 Replies
7. Shell Programming and Scripting
Hi,
I would like to seek help on how i can arrive on this result.
sample.txt:
product_code IN (param001) and product_type IN (param004)
product_code IN (param002) and product_type IN (param005)
product_code IN (param003) and product_type IN (param006)
I would like to change the param001... (1 Reply)
Discussion started by: janzper
1 Replies
8. UNIX for Dummies Questions & Answers
Is there a way to use the sed command to
1) search a specified pattern
2) in the line where that pattern is found, replace from character N to character N+4 with a new 4-character string.
Thks in advance! (5 Replies)
Discussion started by: mvalonso
5 Replies
9. UNIX for Dummies Questions & Answers
Hello Folks,
Anyone know how I can replace this line in file.xml
<oacore_nprocs oa_var="s_oacore_nprocs">8</oacore_nprocs>
with this line
<oacore_nprocs oa_var="s_oacore_nprocs">1</oacore_nprocs>
using sed or awk ?
Thanks for your time.
Cheers,
Dave (7 Replies)
Discussion started by: d__browne
7 Replies
10. Shell Programming and Scripting
Hi folks,
I need to search and replace specific text in a file and replace it. I have a text file that does not have any newlines or carriage returns. All newlines have been removed. Here is what I need to do.
Find the exact string “DH” (quotes included) and replace it with \n”DH” (basically... (6 Replies)
Discussion started by: bridgeje
6 Replies