in reply to Re^2: AWK? Split one file in seperate files based on country
in thread AWK? Split one file in seperate files based on country

Nice golfing :)

You'd have to remember to delete the output files before a re-run; and if the input is big, reopening the output files would likely be a significant factor.

I kept thinking about the one-arg open, but I couldn't make it work with an array element.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

  • Comment on Re^3: AWK? Split one file in seperate files based on country

Replies are listed 'Best First'.
Re^4: AWK? Split one file in seperate files based on country
by jwkrahn (Abbot) on May 31, 2012 at 10:53 UTC
    I kept thinking about the one-arg open, but I couldn't make it work with an array element.
    perl -F';' -ane'$F = ">>$F[0].csv"; open F and print F' junk.dat