I have a csv file in my Linux machine, where I'm trying to make a few queries. But some of the columns in the csv have NULLS and it isn't expressed within the delimiters, So I'm finding it difficult to query the other columns because of the in consistency.
The format now is :
col1,col2,col3,col4,col5... col23
"val1","val2",NULL,"Val3","val4","val5",...,"val23"
"val1","val2","val2",NULL,"val4","val5",...,"val23"
I'm trying to replace the NULL here in different columns to have delimiters around.
awk -F "," 'BEGIN {OFS="\",\""} $3 == "NULL" { $3 = "\"NULL\"" } {print $3}' file1.csv
So far I've tried playing around with awk, but nothing seems to work. Is there a better approach or can someone help with the above command?