10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
echo {mbr_key,grp_key,dep_key,abc,xyz,aaa,ccc} |
awk 'gsub(/^|abc,|$/,"") {print}'
Required output
{grp_key,xyz,aaa,ccc} (5 Replies)
Discussion started by: 100bees
5 Replies
2. Shell Programming and Scripting
Hi All,
I have a XML file which is looks like as below. <<please see the attachment >>
<?xml version="1.0" encoding="UTF-8"?>
<esites>
<esite>
<name>XXX.com</name>
<storeId>10001</storeId>
<module>
... (4 Replies)
Discussion started by: Rajeev_hbk
4 Replies
3. Shell Programming and Scripting
Hi Everybody,
I am having a query like I want to change only first three patterns of the first line in a file.
ex: I like unix unix unix unix is very much.
after using the command it should be like
I like linux linux linux unix is very much.
Thanks,
Naga (3 Replies)
Discussion started by: nagraju.allam
3 Replies
4. Shell Programming and Scripting
Hi Everyone,
I am looking for a simple way for replacing all the files under a directory that use the server "xsgd1234dap" with "xsdr3423pap".
For Example:
In the Directory,
$pwd
/home/nick
$ grep -l "xsgd1234dap" *.sh | wc -l
119
I have "119" files that are still using... (5 Replies)
Discussion started by: filter
5 Replies
5. Shell Programming and Scripting
Hi All,
I want to do some calculation in 5th field and then replace the original 5th value to calcualted new value:
ifile
1|2|3|4|one two three|test
Expecting ofile
1|2|3|4|twothree|test
I tried below commands and acheived.
awk -F"|" '{print $5}' ifile | awk '{if (NF==3) {print... (5 Replies)
Discussion started by: Jairaj
5 Replies
6. Shell Programming and Scripting
Hi All,
I have a file in which a number of lines are starting with similar first word but different next words.
I want to replace the any nth word(not 1st or 2nd) with another word.
Eg:- My file contains are like this:-
Ram is a boy.
Ram is a good boy.
Ram plays cricket.
Here I want to... (2 Replies)
Discussion started by: mukeshbaranwal
2 Replies
7. Shell Programming and Scripting
Hello Friends,
How to substitue with a word by another word in file written in VI Editor.
Thanks & Regards
Siva Ranganath
7760774961 (2 Replies)
Discussion started by: sivaranganath
2 Replies
8. Shell Programming and Scripting
Hi,
I want to replace a word in a file which occurs after a particular word.
For example :
$cat file.txt
CASE
WHEN
AND c1 = 'I'
AND c2= '2'
THEN 1
WHEN
AND c1= 'I'
AND c2= '0'
THEN 2
So in this example i want to replace... (4 Replies)
Discussion started by: ashwin3086
4 Replies
9. Shell Programming and Scripting
How can i replace a particular word from string i.e.
var="shiv_dutt_para_shar"
wrd="para"
rep_wrd="PARA"
what i am trying to do that first i'll search if $var catains #wrd or not.
if it contains then i've to replace $wrd with $rep_wrd.
I have tried following
#!/bin/sh
t="shiv... (5 Replies)
Discussion started by: jadoo_c2
5 Replies
10. Shell Programming and Scripting
Hi All,
v_notes = "Ravi & kumar & garlapati"
i want out put like "Ravi and kumar and garlapati"
What is the command to get this as output, we have to replace all & with and.
Hope this is clear.
Regards,
Ravi Kumar Garlapati (1 Reply)
Discussion started by: rkrgarlapati
1 Replies