Re: filtering for identical field labels
- From: Janis <janis_papanagnou@xxxxxxxxxxx>
- Date: Fri, 30 Nov 2007 07:34:50 -0800 (PST)
On 30 Nov., 15:47, Al <palcibiades-fi...@xxxxxxxxxxx> wrote:
Janis wrote:
/^\*\*\*record/ { tags="" }
Initialize the data for a line of output (stored in var tags).
/^#/ { print tags }
Finalize processing of a line output.
/^irrelevant/ { next }
Ignore those lines.
{ sep = (t!=$1 ? (tags=="" ? "" : "\t") : " ") }
Construct the separator between fields on a line;
NULL "" initially at the front of the line,
TAB "\t" in case the stored tag t differs from preceeding tag,
SPACE " " in case the same tag as before occurred.
{ tags = tags sep $2 ; t = $1}
Construct output line and safe tag field $1 in t for comparison.
(BTW, the last two blocks {...} can be joined, of course.)
Janis, thank you enormously for this. It will take me a day or so to
decipher,
You're welcome. Comments added.
Janis
and I now feel deeply glad not to have posted my own stumbling.
efforts to do it! To say they were crude and fumbling by comparison is an
understatement.
- References:
- filtering for identical field labels
- From: Al
- Re: filtering for identical field labels
- From: Janis
- Re: filtering for identical field labels
- From: Al
- filtering for identical field labels
- Prev by Date: Re: filtering for identical field labels
- Next by Date: boolean expr
- Previous by thread: Re: filtering for identical field labels
- Next by thread: boolean expr
- Index(es):
Relevant Pages
|