INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

AWK Store Line for later use

AWK Store Line for later use

(OP)
I have log file containing a large amount of unformatted text.
I want to take the top text from my log file and append a job id from the text below it.

Stream Client Group DataSet Name Type Size Time Exitcode
------ -------------------- -------------------- ------------------------------------------------------------ --------- ------------------- --------- --------
1 XSERVER2 ALL 0000000000000000000000000000000000000000 Archive 000000000000000 00000000 0
2 XSERVER2 ALL 0000000000000000000000000000000000000000 Archive 000000000000000 00000000 0
3 XSERVER2 ALL 0000000000000000000000000000000000000000 Archive 000000000000000 00000000 0
4 XSERVER2 ALL 0000000000000000000000000000000000000000 Archive 000000000000000 00000000 0
5 XSERVER2 ALL 0000000000000000000000000000000000000000 Archive 000000000000000 00000000 0
6 XSERVER2 ALL 0000000000000000000000000000000000000000 Archive 000000000000000 00000000 0
7 XSERVER2 ALL 0000000000000000000000000000000000000000 Archive 000000000000000 00000000 0
8 XSERVER2 ALL 0000000000000000000000000000000000000000 Archive 000000000000000 00000000 0
9 XSERVER2 ALL 0000000000000000000000000000000000000000 Archive 000000000000000 00000000 0
10 XSERVER2 ALL 0000000000000000000000000000000000000000 Archive 000000000000000 00000000 0
11 XSERVER2 ALL 0000000000000000000000000000000000000000 Archive 000000000000000 00000000 0
12 XSERVER2 ALL 0000000000000000000000000000000000000000 Archive 000000000000000 00000000 0
13 XSERVER2 ALL 0000000000000000000000000000000000000000 Archive 000000000000000 00000000 0
14 XSERVER2 ALL 0000000000000000000000000000000000000000 Archive 000000000000000 00000000 0
15 XSERVER3 ALL 0000000000000000000000000000000000000000 Archive 000000000000000 00000000 0
16 XSERVER3 ALL 0000000000000000000000000000000000000000 Archive 000000000000000 00000000 0
17 XSERVER3 ALL 0000000000000000000000000000000000000000 Archive 000000000000000 00000000 0
18 XSERVER3 ALL 0000000000000000000000000000000000000000 Archive 000000000000000 00000000 0
19 XSERVER3 ALL 0000000000000000000000000000000000000000 Archive 000000000000000 00000000 0
20 XSERVER3 ALL 0000000000000000000000000000000000000000 Archive 000000000000000 00000000 0
21 XSERVER3 ALL 0000000000000000000000000000000000000000 Archive 000000000000000 00000000 0



Stream Job# Status: Description
------ ------ -----------------------------------------------------------------
1 11111 0: the requested operation was successfully completed

Stream Job# Status: Description
------ ------ -----------------------------------------------------------------
2 22222 0: the requested operation was successfully completed

------ ------ -----------------------------------------------------------------
3 33333 0: the requested operation was successfully completed



My desired output would contain text from the upper and lower text blocks.
For example.

1|XSERVER3|ALL|0000000000000000000000000000000000000000|Archive|000000000000000|00000000|0|11111
2|XSERVER3|ALL|0000000000000000000000000000000000000000|Archive|000000000000000|00000000|0|22222
3|XSERVER3|ALL|0000000000000000000000000000000000000000|Archive|000000000000000|00000000|0|33333



can I accomplish this with awk?

RE: AWK Store Line for later use

(OP)
Thanks PH. Got me a lot closer than I was. :)
Output did result in a lot of extra pipes. Any idea why?
Also could you break down the syntax to help me understand.
Thanks again!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close