in reply to Re^3: Split tab-separated file into separate files, based on column name (open on demand)
in thread Split tab-separated file into separate files, based on column name

IO::All does this.

  • Comment on Re^4: Split tab-separated file into separate files, based on column name (open on demand)

Replies are listed 'Best First'.
Re^5: Split tab-separated file into separate files, based on column name (open on demand)
by jo37 (Curate) on Aug 28, 2020 at 16:37 UTC

    Great module! So with IO::All this could yield:

    $ perl -MIO::All -F'/\t/' -lnae '@files = @F, next if 1 .. 1; @f = @fi +les; $_ >> io(shift @f) for @F' <<EOF id name position 1 Nick boss 2 George CEO 3 Christina CTO EOF $ paste id name position 1 Nick boss 2 George CEO 3 Christina CTO

    EDIT Removed do statement.

    Greetings,
    -jo

    $gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$