10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
i Have a file as following
view pz19a0c0/1000T_J_3MoDw9DSLh1ZsCubdua-LKOQmbtiVgkIsiMbSiwF467?sessionId=15451401994597121249
view pz19a0c0/100086X67pR0MwzWnhhSO6sAEoxeFMyhh-IIbUCCdxicaQM4FC9?sessionId=154514019945971212494898
view/cart ... (5 Replies)
Discussion started by: Raghuram717
5 Replies
2. Shell Programming and Scripting
Hi, I need to run a Fortran program which reads a input file with a fixed name many times, each time I need to change a number (real) in that input file, this is how I currently do it and I know it is not elegent at all:
cp inputfile.dat backup.dat
sed -i 's/28.0/0.01/g' inputfile.dat
./myCode... (3 Replies)
Discussion started by: dypang
3 Replies
3. Shell Programming and Scripting
Hello, I have an assignment that requires us to use sed only. The first part of the assignment says to use a sed script to print only the even lines, but if it is print, the number of that lines needs to be printed before the text.
ex:
2
line 2 text
4
line 4 text
6
line 6 text
... (3 Replies)
Discussion started by: stevent518
3 Replies
4. Shell Programming and Scripting
I have number 192.168.21.8.
I want to extract from this number with sed 21 and 8 to variables a and b. Any Ideas?
I did like 's/\(192.168.\)/ /' but its wrong :( (6 Replies)
Discussion started by: Natalie
6 Replies
5. Shell Programming and Scripting
I have looked around and there are several examples of how to use sed, but I don't think any of them help me very much with what I am trying to do.
I have a text file like this....
1! SRCNAM = 00001 !
1! X = 50.0000, 0.0000,... (10 Replies)
Discussion started by: mercury.int
10 Replies
6. Shell Programming and Scripting
Hi,
I have a text file with an array of numbers such as :
123 1 456 45 9817 1 45
I would like to replace the digit "1" in a text file with "A". So it looks like this:
123 A 456 45 9817 A 45
If I use sed 's/1/A/g', I get
A23 A 456 45 98A7 A 45
I... (3 Replies)
Discussion started by: jejeking
3 Replies
7. Shell Programming and Scripting
Patches have the following syntax: Patchxxxx.xxx where x is a number. I'm trying to strip the .xxx off of the patch, so I tried this:
sed 's/PATCH./Patch/' patchin.log > patchout.log
But that of course changed Patchxxxx.xxx to Patch. Ooops, what is the syntax i'm looking for?
thanks (3 Replies)
Discussion started by: dba_frog
3 Replies
8. Shell Programming and Scripting
If I have a set of strings,
C21
F231
H42
1C10
1F113
and I want to isolate the ints following the char, what would the sed string be to find numbers after letters?
If I do,
*, I will get numbers after letters, but I am looking to do something like,
sed 's/*/\t*/g'
this will give me... (14 Replies)
Discussion started by: LMHmedchem
14 Replies
9. Shell Programming and Scripting
I get the same value "chinchwad" for the following 3 statements.
echo "ABCDchinchwad18-Mar-2010-11.sql.zip" | sed -r 's/(+)(+)(.*)/\2/'
echo "ABCDchinchwadII18-Mar-2010-11.sql.zip" | sed -r 's/(+)(+)(.*)/\2/'
echo "ABCDchinchwad918-Mar-2010-11.sql.zip" | sed -r 's/(+)(+)(.*)/\2/'
I expect:... (4 Replies)
Discussion started by: shantanuo
4 Replies
10. Shell Programming and Scripting
Hi,
I would like to get only number in the following strings.
var1="Type20"
var2="type 3"
var3="value 2"
var4="Type 1 Datacenter Hall 2"
I would like to extract output as 20 from var1 and 3 from var2,2 from var3 and 1 from var4.
Appreciate any one help asap..
Regards,
Aji (5 Replies)
Discussion started by: ajilesh
5 Replies