So, I have the following code:
cat testfile.txt | awk -F, '{ print $1" "$2" "$3" "$4" "$5 }' | read DOC ORG NAME
echo "$DOC"
echo "$ORG"
echo "$NAME"
My testfile.txt looks something like the following:
Document Type,Project Number,Org ID,Invoice Number
It will eventually be more complicated, but that's not the point.
WHY OH WHY does awk insist on using " " as a field separator, in addition to the ","? What am I doing wrong here? My output is
Document
Type
I have tried using BEGIN and setting FS=',' . I've tried putting quotes everywhere I can think of, of every type. No dice.