10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I want to remove the spaces from all the lines matching a particular pattern from my file. For instance in file abc.txt I have following data.
Header,This is the header
111,this is 1st record
222, this is 2nd record
333, this is 3rd record
Footer,3 records found
Footer,111222333 ... (5 Replies)
Discussion started by: decci_7
5 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
I have the following code and want to get only the comments.
Ideally I would like to replace the characters to the left of the first '!' in the line with blanks.
real, dimension(:), allocatable :: ft ! stores a single trace
real, dimension(:), allocatable :: tr ! stores a single... (8 Replies)
Discussion started by: kristinu
8 Replies
4. Shell Programming and Scripting
I have a file a file having entries are like
@ram@sham@sita
@krishan@kumar
@deep@kumar@hello@sham
in this file all line are having different no of pattern-@.
need to fetch the substring after the last pattern.
like
sita
kumar
sham
thanks in advance (3 Replies)
Discussion started by: saluja.deepak
3 Replies
5. Shell Programming and Scripting
I couldn't figure out how to use sed or any other shell to do the following. Can anyone help? Thanks.
If seeing a string (e.g., TODAY) in the line,
replace a string in the line above (e.g, replace "Raining" with "Sunny")
and replace a string in the line below (e.g., replace "Reading" with... (7 Replies)
Discussion started by: sprinner
7 Replies
6. Shell Programming and Scripting
one.txt
ONS.820.log:V 20Oct2010:GP ^ ^
ONS.123.log:V 21Oct2010:GP ^ ^
ONS.820.log:V 30Oct2010:GP ^ ^
want to make new file from existing one with addition.
20Oct2010 User KV001 has name tk003 with buffer- 338-1
21Oct2010 User KV003 has name tk002 with buffer- 338-2
30Oct2010 User KV002... (5 Replies)
Discussion started by: saluja.deepak
5 Replies
7. Shell Programming and Scripting
Hi All,
I am pretty new to pattern matching and extraction using shell scripting. Could anyone please help me in extracting the word matching a pattern from a line in bash.
Input Sample (can vary between any of the 3 samples below):
1) Adaptec SCSI RAID 5445
2) Adaptec SCSI 5445S RAID
3)... (8 Replies)
Discussion started by: jharish
8 Replies
8. Shell Programming and Scripting
Hi Everybody,
I would like you to help me with the following problem.
Given is a path to a file like this:
/root/DIR/subdir/file.dat
Having this path I would like to grep/sed or whatever the directory string
that matches the following pattern ''.
I just need the matching directory... (5 Replies)
Discussion started by: hhoosscchhii
5 Replies
9. Shell Programming and Scripting
Hi,
I have file 1.txt with following entries as shown:
0152364|134444|10.20.30.40|015236433
0233654|122555|10.20.30.50|023365433
**
**
**
In file 2.txt I have the following entries as shown:
0152364|134444|10.20.30.40|015236433
0233654|122555|10.20.30.50|023365433... (4 Replies)
Discussion started by: imas
4 Replies
10. UNIX for Dummies Questions & Answers
Hi ,
I have 5 columns total and am wanting to search lines in columns 3-5 and basically grep -v patterns that match 'BBB_0123' 'BVG_0895' 'BSD_0987'
Does anyone know how to do this? I tried combining grep -v with grep -e but, it didn't work.
Thanks! (5 Replies)
Discussion started by: greptastic
5 Replies