10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Can anyone help me with sed or awk to do a bulk replace of the below requirements.
"REC_ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (
START WITH +7486
INCREMENT BY +1
MINVALUE +7467
MAXVALUE... (6 Replies)
Discussion started by: ilugopal
6 Replies
2. Shell Programming and Scripting
'Hi
I'm using the following code to extract the lines(and redirect them to a txt file) after the pattern match. But the output is inclusive of the line with pattern match.
Which option is to be used to exclude the line containing the pattern?
sed -n '/Conn.*User/,$p' > consumers.txt (11 Replies)
Discussion started by: essem
11 Replies
3. Shell Programming and Scripting
Hi
I have written a shell script which used sed code below
sed -i 's/'"$Pattern"'/ /g' $FileName
I want to count the length of Pattern and replace it with equal number of spaces in the FileName.
I have used $(#pattern) to get the length but could not understand how to replace... (8 Replies)
Discussion started by: rakeshkumar
8 Replies
4. Shell Programming and Scripting
QUESTION1:
How do you grep only an exact string. I am using Solaris10 and do not have any GNU products installed.
Contents of car.txt
CAR1_KEY0
CAR1_KEY1
CAR2_KEY0
CAR2_KEY1
CAR1_KEY10
CURRENT COMMAND LINE: WHERE VARIABLE CAR_NUMBER=1 AND KEY_NUMBER=1
grep... (1 Reply)
Discussion started by: thibodc
1 Replies
5. Shell Programming and Scripting
Hi,
Thanks for looking at this issue.
I have many words/lines in a files like below
apple
pine apple
custored apple apple
apple
if i want to replace only/exact apple occurrences with XXX i could use below,
sed 's/\<apple\>/XXX/g' filename
this is working in Linux, but now in my free BSD... (3 Replies)
Discussion started by: ramanaraoeee
3 Replies
6. Shell Programming and Scripting
I have a file
DS1
DDS
DS
I want to replace only "DS" to "DSmail.blah.com" in a lot of files. I tried
sed 's/DS/DSmail.blah.com' but it changes all the lines .
thanks in advance (2 Replies)
Discussion started by: gubbu
2 Replies
7. Shell Programming and Scripting
Lets say I have file.txt:
(Product:Price:QuantityAvailable) (: as delimiter)
Chocolate:5:5
Banana:33:3
I am doing a edit/update function.
I want to change the Quantity Available, so I tried using the SED command to replace 5, but my Price which is also 5 is changed instead.
(for the Banana... (13 Replies)
Discussion started by: andylbh
13 Replies
8. Shell Programming and Scripting
how would you get SED to do the following, say you have the following lines in a text file:
user=tigger
some text some text
some text some text
some text some text
user=ted
some text some text
some text some text
some text some text
user=thekingofrockandroll
you want to find any line... (15 Replies)
Discussion started by: rich@ardz
15 Replies
9. Shell Programming and Scripting
Hi guys,
got a problem here with sed on the command line.
If i have a string as below:
online xx:wer:xcv: sdf:/asdf/http:https-asdfd
How can i match the pattern "http:" and replace the start of the string to the pattern with null?
I tried the following but it doesn't work:
... (3 Replies)
Discussion started by: DrivesMeCrazy
3 Replies
10. Shell Programming and Scripting
I am really need help with the regular expression in SED. From input file, I need to extract lines that have the port number (sport or dport) as defined. The input file is something like this
time=1209515280-1209515340 dst=192.168.133.202 src=208.70.8.23 bytes=2472 proto=6 sport=80 dport=1447... (6 Replies)
Discussion started by: new_buddy
6 Replies