10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Need help on replacing every second instance of delimeter.
Scenario:
var="Name1,Value1,Name2,Value2,Name3,Value3,Name4,Value"
I want every second "," to replace with "|"
I tried like below
echo $var| sed 's/,/|/2'
But, it's not working.
Expected output:
... (4 Replies)
Discussion started by: Sumanthsv
4 Replies
2. Shell Programming and Scripting
I wanted to search for a string and replace it with other string from nth column of a file which is comma seperated which I am able to do with below
# For Comma seperated file without quotes
awk 'BEGIN{OFS=FS=","}$"'"$ColumnNo"'"=="'"$PPK"'"{$"'"$ColumnNo"'"="'"$NPK"'"}{print}' ${FileName} ... (5 Replies)
Discussion started by: Amit Joshi
5 Replies
3. Shell Programming and Scripting
Hi
I got the following problem and I wonder if some could please help me out?
I'd like to replace character 8 - 16 , 16 - 24
cat file
... (2 Replies)
Discussion started by: stinkefisch
2 Replies
4. Shell Programming and Scripting
Hi,
I hope you can help me out please?
I need to replace from character 8-16 with AAAAAAAA and the rest should stay the same after character 16
gtwrhtrd11111111rjytwyejtyjejetjyetgeaEHT
wrehrhw22222222hytekutkyukrylryilruilrGEQTH
hrwjyety33333333gtrhwrjrgkreglqeriugn;RUGNEURGU
... (4 Replies)
Discussion started by: stinkefisch
4 Replies
5. Shell Programming and Scripting
Using Awk, how can I achieve the following?
I have set of record numbers, for which, I have to replace the nth field with some values, say spaces.
Eg:
Set of Records : 4,9,10,55,89,etc
I have to change the 8th field of all the above set of records to spaces (10 spaces).
Its a delimited... (1 Reply)
Discussion started by: deepakwins
1 Replies
6. Shell Programming and Scripting
test.txt is the dynamic file but some of combination are fix
like below are the lines
;wonder_off =
;wonder_off = disabled
wonder_off =
wonder_off = disabled
the test.txt can content them in any order
#cat test.xt
;wonder_off =
;wonder_off = disabled
wonder_off =
wonder_off =... (5 Replies)
Discussion started by: SilvesterJ
5 Replies
7. Shell Programming and Scripting
I have a record like the one given below.
010000306551~IN ~N~ |WINDWARD PK|Alpharetta|
If ~ is present more than instance in a line,then I need to delete those instances.
Any ideas?
I am working in Solaris (7 Replies)
Discussion started by: prasperl
7 Replies
8. Shell Programming and Scripting
folks..
i need a simple one liner to extract data from between the (n)th and (n+1)th instance of a line in a 2 colum file.
eg....for n=3 i should get back
0 1
4 6
help would be much appreciated.
file blah.txt
##################
identifer line
0 3
0 3
identifer line
0 2
0... (5 Replies)
Discussion started by: ryanp200
5 Replies
9. Shell Programming and Scripting
Hello,
I want to replace 2nd instance of "foo" in a file use sed.
Any suggestions? (2 Replies)
Discussion started by: katrvu
2 Replies
10. Shell Programming and Scripting
Alright, I think I know what I am doing with sed(which probably means I don't). But I cant figure out how to replace just the first occurance of a string. I have tried sed, ed, and grep but can't seem to figure it out. If you have any suggestions I am open to anything! (3 Replies)
Discussion started by: IronHorse7
3 Replies