I'm sorry, by modifying sed example I meant embedded in your example prints "an an hour." I understand why (2nd statement matching "(a)n" from 1st...so how to fix? ---------- Post updated at 08:38 AM ---------- Previous update was at 08:27 AM ---------- Don:
Thanks for taking the time to demonstrate awk example. I must have been confused before when I ran array ["hour"] and thought I saw the correct result. Just re-tested and indeed it doesn't work. So pipes | are used for complete words.
I want to print out a directory listing, then append ] to the end of each line. I'm trying to create a list of Wiki links based on folder listings that i can just copy and paste without having to edit 100's of file listings.
Using sed i've figured out to do something like this:
sed... (4 Replies)
Hi,
I am trying to add a blank line between sets of replicate values. I have been trying to use
uniq -D -f4 input.txt > output.txt
The input is like
V2-1.0 -1.0 5500.00 4162.00 529976.06030125.0 1997A
V2-1.0 -1.0 6000.00 4285.00 ... (6 Replies)
Hello everyone, I've suddenly gotten very interested in sed and awk (and enjoying it quite a bit too) because of a large conversion project that we're working on. I'm currently stuck with a very inefficient process for processing text blocks. I'm sure someone here should be able to easily point out... (2 Replies)
hi all,
i have some functions in a text file
ex:"int* function(int param)"
i find this functions with the command "var=grep -o "int**(*)" textfile"
i tested this regex and it's working
now i want to take only the name of the function from the grep result,
in my example "function"
how can... (1 Reply)
Hello:
(exp) : match "exp",the matched text is stored in auto named arrays.
How can I get the matched text ? What is the name of the auto named arrays on linux shell ? (4 Replies)
hi dudes, I nee you kind assistance, I have to find the matched numbers from 2 text files and output of matched numbers should be in another text file..
I do have text files like this , for example
File 1
787
665*5-p
5454
545-p
445-p
5454*-p
File 2
5455
787
445-p
4356
2445
144
... (3 Replies)
Hi,
I have a file with email header information. I would like to change the Subject line.
Subject: ** PROBLEM Host Alert: server.domainname is DOWN **
I'd like to change this line such as to look,
Subject: serverID ACK Fw: ** PROBLEM Host Alert: server1.domainname is DOWN**
How can I... (2 Replies)
Hi everyone. I need to change a script (ksh) so that it will grep on the 1st 2 letters in the second column of a 5 column file such as this one:
192.168.1.1 CAXY0_123 10ABFL000001 # Comment
192.168.1.2 CAYZ0_123 10ABTX000002 # Comment
192.168.2.1 FLXY0_123 11ABCA000001 ... (4 Replies)
I need to search a string for some specific text which is no big deal using grep. My problem is when the search fails to find the text. I need to add text like "na" when my search does not match.
I have tried this command but it does not work when I put the command in a loop in a bash script:
... (12 Replies)
I've been struggling with this one for quite a while and cannot seem to find a solution for this find/replace scenario. Perhaps I'm getting rusty.
I have a file that contains a number of metrics (exactly 3 fields per line) from a few appliances that are collected in parallel. To identify the... (3 Replies)