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
With awk
awk '{out = "File" $NF ".txt"; print >> out; close(out)}' file
More efficient, not closing the destination file after every line:
awk ' $NF != dest {if (out) close(out); dest = $NF; out = "File" dest ".txt"} {print >> out} ' file