Hello,
With the help of
http://www.linuxquestions.org/questi...ng-awk-824408/ I was able to write a awk oneliner to split a file into multiple files based on a column.
Code:
awk -F"|" ' { print $2 > "TEST_"$1".csv" } ' ABC.csv
This script works perfectly in splitting the file. I want one additional functionality added to this script on placing the resultant into a specific directory.
Source:
/home/Src/ABC.csv
Target:
/home/Res/csv/TEST_1.csv
/home/Res/csv/TEST_2.csv
/home/Res/csv/TEST_3.csv
/home/Res/csv/TEST_4.csv
I'm not sure how to add path to above script. Any help is greatly appreiciated.
Thanks