> On Nov 22, 2019, at 9:06 AM, Marc Chantreux <e...@phear.org> wrote:
>
> hello,
>
> On Fri, Nov 22, 2019 at 03:07:28PM +0100, Patrick Spek via perl6-users wrote:
>> Could you post some input and expected output? That would make it
>> easier for me (and perhaps others) to see what exactly you're trying to
>> accomplish, in practical terms.
>
> sorry ... i'm so confortable with awk i haven't though about some are
> not. i sincerely apologize.
>
> Basically i want to figure out what are the sections, subsections of of
> a CSV file:
>
> A,1,garbage .....
> A,2,garbage .....
> A,2,garbage .....
> A,2,garbage .....
> A,3,garbage .....
> A,3,garbage .....
> A,3,garbage .....
> B,1,garbage .....
> B,2,garbage .....
> B,2,garbage .....
> B,2,garbage .....
> B,3,garbage .....
> B,3,garbage .....
> B,3,garbage .....
>
> becomes
>
> A
> 1
> 2
> 3
> B
> 1
> 2
> 3
>
> regards,
> marc
Marc,
When I run your original Awk code against the .csv data you listed above, I get
this output:
A
2
3
B
2
3
The first key of each second level is missing, which differs from your sample
output above.
Have I corrupted your Awk code, or have I misunderstood something, or what?
--
Thank you,
Bruce Gray (Util of PerlMonks)