in reply to Re: Split output by tabs
in thread Split output by tabs

wow, it works great! thank you :)Just one more question, is there a way of specifying certain columns to be printed? e.g the 10th,18th and 20th column?

Replies are listed 'Best First'.
Re^3: Split output by tabs
by shmem (Chancellor) on Nov 13, 2012 at 09:41 UTC
    is there a way of specifying certain columns to be printed? e.g the 10th,18th and 20th column?

    One way to do it - use an array slice:

    { local $" = "\t"; print $OUT map "@{$_}[10,18,20]\n", sort { $a->[10] cmp $b->[10] } @ +out; }

    See References quick reference.

      wow that is perfect, where can i read up on in regards to skipping blank/empty values when splitting arrays? :)
        where can i read up on in regards to skipping blank/empty values when splitting arrays?

        Something is wrong wrt your question, since you don't split arrays, you slice or join them. Do you mean omitting empty fields splitting a record, or omitting empty/undefined array elements joining an array?