Subject: | |
From: | |
Reply To: | |
Date: | Tue, 21 Nov 2000 14:28:20 -0500 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
You can't do it using SUPRTOOL, I'm pretty sure.
You can do it using AWK (AWK.HPBIN.SYS) or Perl.
For example, assuming there's no header and the fields are blank-separated,
here's an AWK program that does what you want:
function dump() { if (length(buf)) print buf}
$1 != hdr {dump(); hdr = $1; buf = $1 }
{ buf = buf " " $2; }
END { dump() }
Of course, you may need more input parsing or output formatting.
AWK.HPBIN.SYS "-f PROGFILE DATAIN" >DATAOUT
----- Original Message -----
From: "Tompkins, Gregory (Salomon)" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Tuesday, November 21, 2000 1:58 PM
Subject: SUPRTOOL QUESTION
> Hello Everyone,
>
> I'm trying to figure out how to produce an output file using SUPRTOOL that
> takes all duplicate input records and adds the unique records on a single
> line.
>
> Example:
>
> INPUT
>
> Shipdoc # Tracking #
>
> 12345 1Z12345
> 12345 1Z123ZZ
> 12345 1Z12300
> 12345 1Z12399
> 12346 1Z00000
> 12346 1Z88888
> 12347 1Z99999
>
> OUTPUT
>
> SHIPDOC # TRACKING #1 TRACKING #2 TRACKING #3 TRACKING
#4
> 12345 1Z12345 1Z123ZZ 1Z12300 1Z12399
> 12346 1Z00000 1Z88888
> 12347 1Z99999
>
> Any help on this would be greatly appreciated!
>
> Regards,
>
> Greg Tompkins
> Salomon North America
> voice/fax +1 (503) 548-7070
> [log in to unmask]
>
|
|
|