I am using a shell script where I split a file according to the values of a certain column (using awk). My script is in a folder X, though, and I need the resulting files to be created in a folder Y. How can I do that?This is how the files are currently generated:awk -F';' 'NR==1{h=$0; next}!seen[$3]++{f=FILE_$3.txt;print h > f} {print >> f}' $input
Split files using awk and generate the results in another directory
shell;awk
That should do it, I think. Just pass awk the full path of the directory you want the file created/updated in.awk -F';' -v path=/path/to/alt/directory/ 'NR==1{h=$0; next}!seen[$3]++{f= path FILE_ $3 .txt;print h > f} {print >> f}' $input