![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Is There a Sed Solution for This? | racbern | Shell Programming and Scripting | 1 | 03-13-2008 11:31 AM |
| need solution for scripting | kkc | Shell Programming and Scripting | 14 | 01-31-2008 09:17 PM |
| Sun and backup solution | Jshwon | SUN Solaris | 1 | 10-23-2007 01:54 PM |
| Grep solution | Amruta Pitkar | Shell Programming and Scripting | 3 | 05-03-2007 03:57 AM |
| Linux as a NAS solution? | kjbaumann | Linux | 1 | 08-30-2006 01:09 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Is there a awk solution for this??
I am writing a awk script that gathers certain data from certain fields. I needed a awk solution for this, because it will later become a function in the script. I have the following data that I need output on a single line, but record spans across multilple lines and records are not "together". Example would be tom below, record "tom" below is on 4 different lines, but I only need data from 2 of the lines, I will also need the same info for pat, tim, and tad, or whoever else has a record like the format below. Code:
2008 fl01 LAC 2589 polk doal
xx 2008q1 mx
sect 25698541
Sales 08 Dept group
lead1 2008q1
tom
pat
tim
tad
lead1 07q4 07q3 07q2 07q1 06q4 06q3 jan
tom 0 96 0 3312 3624 0 312
pat 0 17 0 0 30 0 30
tim 357 03 04 25 3020 3120 20
tad 1734 0 0 0 5213 5213 0
lead1 feb mar apr may jun jul aug
tom 0 96 0 0 0 0 0
pat 0 17 0 0 0 0 0
tim 357 23 5 7 8 14 70
tad 1734 0 0 0 0 0 0
lead1 sept oct nov dec
tom 0 0 460 92
pat 0 0 240 0
tim 0 21 1800 0
tad 0 0 672 0
2008 fl01 LAC 2589 polk doal
yy 2008q1 mx
sect 2569852
Sales 08 Dept group
I needed the following output: Code:
lead1 07q4 07q1 06q4 06q3 sept oct nov tim 357 25 3020 3120 0 21 1800 tad 1734 0 5213 5213 0 0 672 Is there a awk solution to this?? thanks in advance for this, because I think this is a difficult one. |
| Bookmarks |
| Tags |
| solaris |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|