I searched for awhile and couldn\'t find a response to this. I have a standard tsv file with the following format:
1 100 101 350 A
1 101 102
So the scripting single-pass low memory line-by-line approach:
while IFS=" " read -r value1 value2 value3 value4 value5 remainder
do
echo $value1 $value2 $value3 $value4 $value5 $remainder >> output.${value5}.txt
done < "input.txt"
Of course, you need to ensure there are no pre-existing output files, but that can be achieved a number of ways efficiently.