10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
In the awk below I am trying to remove all lines above and including the pattern Test or Test2. Each block is seperated by a newline and Test2 also appears in the lines to keep but it will always have additional text after it. The Test to remove will not. The awk executed until the || was added... (2 Replies)
Discussion started by: cmccabe
2 Replies
2. Shell Programming and Scripting
Team,
I am trying to use sed to delete 15 lines, after pattern patch, which includes the pattern as well in Solaris. I used the below command, as we do it Linux, but it's not working as expected in Solaris.
I am getting the error as "garbled".sed '/\/table/,+15d' status.html
sed: command... (8 Replies)
Discussion started by: Nagaraj R
8 Replies
3. Shell Programming and Scripting
Hello everyone,
I have a sample data like this:
Glyma.10G051100 Glyma.02G036000 89.91 228 23 0 1 228 1 228 1e-78 294
Glyma.10G051100 Glyma.09G023700 87.28 228 29 0 1 228 1 228 1e-68 261
Glyma.10G285200 Glyma.20G103800 96.33 1663 55 4 1 1657 1 1663 0.0 2728
Glyma.10G285200 Glyma.05G093700 95.02... (2 Replies)
Discussion started by: nengcheng
2 Replies
4. Shell Programming and Scripting
Not sure how I can accomplish this. I would like to remove all interfaces that have the commands I would like to see: switchport port-security, spanning-tree portfast. One line is no problem.
interface FastEthernet0/8
spanning-tree portfast
interface FastEthernet0/9
spanning-tree... (4 Replies)
Discussion started by: mrlayance
4 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I have 2 files like below.
File A:
apple
mango
File B:
start
abc
def
apple
ghi
end
start
cba
fed (4 Replies)
Discussion started by: jayadanabalan
4 Replies
6. Shell Programming and Scripting
Hi,
I have more than 30,000 records in a flat file. I want to remove footer from the file by searching a string pattern for the footer.
Example.... let the flat file test.dat contains below records.
record1
record2
record3
..
..
..
record31000
Total records 31000
I want to remove the... (6 Replies)
Discussion started by: gani_85
6 Replies
7. Shell Programming and Scripting
Hi,
I have requirement that I need to split my input file into two files based on a search pattern "abc"
For eg. my input file has below content
abc
defgh
zyx
I need file 1 with
abc
and file2 with
defgh
zyx
I can use grep command to acheive this. But with grep I need... (8 Replies)
Discussion started by: sbhuvana20
8 Replies
8. Shell Programming and Scripting
I need to remove all lines which does not match the pattern from a text file (batch of text files). I also need to keep the header line which is the first line of the file. Please can you provide an example for that.
I used this to solve half of my work. I was unable to keep the first line of... (3 Replies)
Discussion started by: talktobog
3 Replies
9. Shell Programming and Scripting
hi,,
i hav a file with many lines.i need to remove all lines before a line begginning with a specific pattern from the file because these lines are not required.
Can u help me out with either a perl script or shell script
example:-
if file initially contains lines:
a
b
c
d
.1.2
d
e
f... (2 Replies)
Discussion started by: raksha.s
2 Replies
10. Shell Programming and Scripting
grep for a particular pattern and remove 5 lines above the pattern and 6 lines below the pattern
root@server1 # cat filename
Shell Programming and Scripting test1
Shell Programminsada asda
dasd asd Shell Programming and Scripting Post New Thread
Shell Programming and S sadsa ... (17 Replies)
Discussion started by: fed.linuxgossip
17 Replies