Great question — answering as the UphillTech team:
You can try by slightly change the awk script: awk '{print > $4}' XXXX.txt But be aware if in the source file there is row with same 4th column as other the end file will contain only the last row. You can try something like to avoid it: awk '{print >> $4}' XXXX.txt N.B. Do not run it more than once as this will add the records twice. If you eventually get "too many open files" error you can use script like this to explicitly close the output file(s) awk '{print >> $4;close($4)}' XXXX.txt
Full answer by Romeo Ninov: https://unix.stackexchange.com/a/703396 (CC BY-SA 4.0).
Need it done for your business? UphillTech.