09-28-2010
Print lines between two lines after grep for a text string
Franklin,
file format is
<ROW>
<OBJECT_ID>32948</OBJECT_ID>
<OBJECT_SEQ_NO>1</OBJECT_SEQ_NO>
<OBJECT_DATA> as much as 24 lines X 80 characters </OBJECT_DATA>
</ROW>
OR
<ROW>
<OBJECT_ID>32948</OBJECT_ID>
<OBJECT_SEQ_NO>2</OBJECT_SEQ_NO>
<OBJECT_DATA> or just a single line /OBJECT_DATA>
</ROW>
this could be repeated a thousand times, of course with different information between the <ROW> and </ROW>. I did try your suggestion and got this output:
awk: Line OBJECT_DATA>NAU-AKL- cannot have more than 199 fields.
The input line number is 33. The file is ORACLE_OBJECT_001.xml.good.
The source line number is 1.
9 More Discussions You Might Find Interesting
1. 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
2. Shell Programming and Scripting
frnd,
Is there any way to print only the string that matched the pattern instead printing the whole line?
thanks in advance. (3 Replies)
Discussion started by: clx
3 Replies
3. 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
4. Shell Programming and Scripting
hello,
I go text file like this
E:/DDD/Dyndede/wwww
E:/DDD/sss.com/ffffg/fff
E:/DDD/vvvvvv/dd
E:/DDD/sss.com/bbbbbb
E:/DDD/sss.com/nnnn/xxI want to print
/alpha.jpg at the end of every lines like that
E:/DDD/Dyndede/wwww/alpha.jpg
E:/DDD/sss.com/ffffg/fff/alpha.jpg... (8 Replies)
Discussion started by: davidkhan
8 Replies
5. Shell Programming and Scripting
Hi all,
This should be very easy but I can't figure it out...
I have a file that looks like this:
@SRR057408.1 FW8Y5CK02R652T length=34
AGCAGTGGTATCAACGCAGAGTAAGCAGTGGTAT
+SRR057408.1 FW8Y5CK02R652T length=34
FIIHFF6666?=:88@@@BBD:::?@ABBAAA>8
@SRR057408.2 FW8Y5CK02TBMHV length=52... (1 Reply)
Discussion started by: kmkocot
1 Replies
6. 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
7. Shell Programming and Scripting
Hello,
I want to extract from a file like :
20120530025502914 | REQUEST | whatever
20120530025502968 | RESPONSE | whatever
20120530025502985 | RESPONSE | whatever
20120530025502996 | REQUEST | whatever
20120530025503013 | REQUEST | whatever
20120530025503045 | RESPONSE | whatever
I want... (14 Replies)
Discussion started by: black_fender
14 Replies
8. 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
9. Shell Programming and Scripting
say we have :
2914 | REQUEST | whatever
2914 | RESPONSE | whatever
2914 | SUCCESS | whatever
2985 | RESPONSE | whatever
2986 | REQUEST | whatever
2990 | REQUEST | whatever
2985 | RESPONSE | whatever
2996 | REQUEST | whatever
2010 | SUCCESS | whatever
2013 | REQUEST | whatever
2013 |... (7 Replies)
Discussion started by: Saumitra Pandey
7 Replies
TXAWS(1) User Commands TXAWS(1)
NAME
txAWS - txAWS S3 helper commands
SYNOPSIS
command [options]
txaws-create-bucket
txaws-delete-bucket
txaws-delete-object
txaws-discover
txaws-get-bucket
txaws-get-object
txaws-head-object
txaws-list-buckets
txaws-put-object
OPTIONS
--version
show program's version number and exit
-h, --help
show this help message and exit
-a ACCESS_KEY, --access-key=ACCESS_KEY
access key ID
-s SECRET_KEY, --secret-key=SECRET_KEY
access secret key
-r REGION, --region=REGION
US or EU (valid for AWS only)
-U URL, --url=URL
service URL/endpoint
-b BUCKET, --bucket=BUCKET
name of the bucket
-o OBJECT_NAME, --object-name=OBJECT_NAME
name of the object
-d OBJECT_DATA, --object-data=OBJECT_DATA
content data of the object
--object-file=OBJECT_FILENAME
the path to the file that will be saved as an object; if provided, the --object-name and --object-data options are not necessary
-c CONTENT_TYPE, --content-type=CONTENT_TYPE
content type of the object
txAWS 0.2.3 May 2012 TXAWS(1)