I have a file of about 1B records, each containing 50 tab-separated fields. I'm writing a small app to pass this file on an ad-hoc basis, selecting and concatenating various of these fields.
For example: if the input file contains
I might wish to extract fields 3, 1, and 6:LAST\tFIRST\tCITY\n
My current approach begins by splitting each record into a 50-element array and then accessing each by index. It's very slow. Can someone suggest a superfast approach to doing this, given only the set of indices I wish to extract?