9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I am having a text file like below
ERROR - Not a valid
ID : 123
ERROR - Not a valid
hello
ID : 124
SUCCESS - Valid
ID : 12
I need to display like below after reading the file if it finds the error keyword
along with displaying this first line when error pattern... (10 Replies)
Discussion started by: rohit_shinez
10 Replies
2. Shell Programming and Scripting
RHEL 5.8
I have a text file like below. I want to grep for a string and then print the next 4 lines including the line with the string I grepped for
For eg:
I want grep for the string HANS and then print the next 4 lines including HANS
$ cat someText.txt
JOHN
NATIONALITY:... (7 Replies)
Discussion started by: omega3
7 Replies
3. Shell Programming and Scripting
Hello,
I would like to kindly ask you for help. I have a file with some lines in one row separated by semicolon. I need to find out, if the line I have in different variable is included in this file. e.g
I have a file foo.txt with lines
A=hello there;hello world;hello there world
In... (6 Replies)
Discussion started by: satin1321
6 Replies
4. Shell Programming and Scripting
Hi.
I have a tab separated file that has a couple nearly identical lines. When doing:
sort file | uniq > file.new
It passes through the nearly identical lines because, well, they still are unique.
a)
I want to look only at field x for uniqueness and if the content in field x is the... (1 Reply)
Discussion started by: rocket_dog
1 Replies
5. Shell Programming and Scripting
Hi
I have this in my file
2011-04-18 15:32:11 system-alert-00012: UDP flood! From xxxxxx to yyyyyyyyyy, int ethernet0/2). Occurred 1 times.
2011-04-18 15:32:11 system-alert-00012: UDP flood! From xxxxxx to yyyyyyyyyy, int ethernet0/2). Occurred 1 times.
2011-04-18 15:32:11... (9 Replies)
Discussion started by: zorrox
9 Replies
6. Shell Programming and Scripting
Hi,
i would like to get the above and below lines of the grep pattern .
For ex :
file as below:
chk1- aaaa
1-Nov
chk2 -aaaa
##########
chk1-bbbbbb
1-Nov
chk2-bbbbbb
#########
my search pattern is date : 1-Nov
i need the o/p as below
chk1- aaaa
1-Nov (6 Replies)
Discussion started by: expert
6 Replies
7. Shell Programming and Scripting
I have several very large file that are extracts from Oracle tables. These files are formatted in XML type syntax with multiple entries like:
<ROW>
some information
more information
</ROW>
I want to grep for some words, then print all lines between <ROW> AND </ROW>. Can this be done with AWK?... (7 Replies)
Discussion started by: jbruce
7 Replies
8. Shell Programming and Scripting
Hi folks
I am not allowed to install GNU grep on AIX.
Here my code excerpt:
grep_fatal () {
/usr/sfw/bin/gegrep -B4 -A2 "FATAL|QUEUE|SIGHUP"
}
Howto the same on AIX based machine?
from manual GNU grep
‘--after-context=num’
Print num lines of trailing context after... (4 Replies)
Discussion started by: slashdotweenie
4 Replies
9. Shell Programming and Scripting
Hi all,
I need help in following scenario. I have a file with about 10,000 lines. There are several lines which have word "START" (all upper case) in them. I want to grep line with word "START" and then do the following
1. Print the line number having word "START"
2. Print the next 11 lines.
... (4 Replies)
Discussion started by: jakSun8
4 Replies