in reply to Split tab-separated file into separate files, based on column name

> so there must be a more clever way :)

You want a one liner and I doubt it'll be very readable.

The clever way is to split the head line and to open files for each entry and to hold the filehandles in an array.

Now you can print each field by column position after splitting the remaining lines.

That's a dozen code lines at most. ..

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

  • Comment on Re: Split tab-separated file into separate files, based on column name