This question already has an answer here:
This is my command:
awk -v DATE="$(date +"%Y%m%d")" -F"," 'NR>1 { print > "Assignment_"$1"_"DATE".csv"}' Text_01012020.CSV
but it come out with this:
Assignment_"A"_01012017
I want to remove "___", can you help me?
I find out this:
awk -v DATE="$(date +"%d%m%Y")" -F"," 'NR>1 { gsub(/"/,"",$1); print > "Assignment_"$1"_"DATE".csv"}' Text_01012020.CSV
but after I run this command, my file can be assignment_A_01012017 but then inside my file..the column not seperated into column. How?
Use below
awk
Explanation
If you want to include your column name, then read it with the case when
NR==1
:And you can also learn for yourself with this great tutorial
Just set "OFS" configuration, then output will be with comma.