On 4/11/2013 12:56 PM, Frank M. Ramaekers wrote:
> I'd like to change it so it shows the omitted lines (minimally):
>
> Slot Vol-ID Rdev Type Status SSIOwner SysOwner
> 1 M01RES 0705 Own Online and attached -------- --------
> -
> 5 VMCOM1 0701 Own Online and attached -------- --------
Since you know the records you keep will be unique, you can blank out
the ones you omit and then use UNIQUE to skip over the duplicates:
"PIPE (endchar ?)",
"| LITERAL QUERY CPOWN",
"| CP",
"| used: PICK SUBSTR 1.6 OF W2 \== /------/",
"| all: faninany",
"| unique first",
"| CONSOLE",
"? used:",
"| specs /-/ 1",
"| all:"
> Or ideally:
>
> Slot Vol-ID Rdev Type Status SSIOwner SysOwner
> 1 M01RES 0705 Own Online and attached -------- --------
> 2 - 4 omitted
> 5 VMCOM1 0701 Own Online and attached -------- --------
That's a tougher juggling act. You need the first of each group of
retained records to trigger output of each group of omitted ones. My
trick for this is to use CHOP 0 to generate a record before each input
record:
"PIPE (end ?)",
" cp QUERY CPOWN",
"| used: pick substr 1.6 of w2 ¬== /------/",
"| before: chop 0",
"| empty: faninany",
"| joincont leading / /",
"| locate",
"| specs w1 1.3 right /-/ n w-1 n.3 right / omitted/ n",
"| all: faninany",
"| cons",
"? used:",
"| chop 4",
"| empty:",
"? before:",
"| all:"
You could also do the whole thing in one complicated SPECS using named
fields and IF, but that wouldn't accommodate cases where you might have
other processing to do on the lines you're grouping together.
¬R