10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I am able to grep multiple patterns which stored in a files. However, how could we replace the whole line with either the pattern or new string?
For example:
pattern_file: *Info in the () is not part of the pattern file. They are the intended name to replace the whole line after the pattern... (5 Replies)
Discussion started by: wxboo
5 Replies
2. UNIX for Beginners Questions & Answers
I'm facing a problem
1) I got a list_file intended to be used for inlace replacement like this
Replacement pattern ; Matching patterns
EXTRACT ___________________
toto ; tutu | tata | tonton | titi
bobo ; bibi | baba | bubu | bebe
etc. 14000 lines !!!
... (5 Replies)
Discussion started by: mpvphd
5 Replies
3. Shell Programming and Scripting
Hello Guys,
I need to replace a string with multiple lines.
For eg:-
ABC,DEF,GHI,JKL,MNO,PQR,STU
need to convert the above as below:-
ABC,DEF,
GHI1
GHI2
GHI3,
JKL,MNO,
PQR1
PQR2
PQR3,
STU
i have tried using code as:- (2 Replies)
Discussion started by: jassi10781
2 Replies
4. Shell Programming and Scripting
Hi Team
I have the following text in one of the file
j1738-abc-system_id(in.value1)-2838 G566-deF-system_id(in.value2)-7489
I want to remove system_id(...) combination completely The output should look like this
j1738-abc-in.value1-2838 G566-deF-in.value2-7489
Any help is appreciated... (4 Replies)
Discussion started by: Thierry Henry
4 Replies
5. Shell Programming and Scripting
Hi Bigshots,
I have a pattern file with two columns. I have another data file. If column 1 in the pattern file appears as the 4th column in the data file, I need to replace it (4th column of data file) with column 2 of the pattern file. If the pattern is found in any other column, it should not... (6 Replies)
Discussion started by: ss112233
6 Replies
6. Shell Programming and Scripting
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)
Discussion started by: spfc_dmt
12 Replies
7. Shell Programming and Scripting
Can someone tell me how I can do this?
e.g:
a=$(echo -e wert trewt ertert ertert ertert erttert
erterte
rterter
tertertert
ert)
How do i replace the STRING with $a?
I try this:
sed -i 's/STRING/'"$a"'/g' filename.ext
but this don' t work (2 Replies)
Discussion started by: jforce
2 Replies
8. Shell Programming and Scripting
Hi guys...Wow I just composed a huge post and it got erased as I was logged out automatically
Anyways I hope someone can help me out here.
So the task I'm working on is like this
I have a bunch of files that I care about sitting in a directory say $HOME/files
Now my job is to go and loop... (6 Replies)
Discussion started by: rukasetsuna
6 Replies
9. Shell Programming and Scripting
Hi,
I've a filename of this format: "XXX_XXX_TXT.TAR.AS". Need to change the name into this format: "XXX_XXX.TAR.AS". This file resides in a directory. I'm ok with using the find command to search and display it.
Essentially I just need to replace the string "_TXT.TAR.AS" to ".TAR.AS". Is awk... (17 Replies)
Discussion started by: chengwei
17 Replies
10. Shell Programming and Scripting
I have awhole bunch of files and I want to edit stringA with stringB without changing the filename.
I have tried the following sed commands:
sed "s/stringA/stringB/g" *
This will print the correct results but does not actually save it with the new content of the file. when I do a cat on... (5 Replies)
Discussion started by: jjoves
5 Replies