I have a very large(200+GB), incorrectly formatted CSV file. Some columns have fewer values than the other columns, i.e.
col1,col2,col3,col4
val2,val3,val5,val6
val2
val2,val3
val2,val4,val8,val9
Obviously, when I try to import this into postgres it will throw an error about missing data for columns. I would like to avoid fixing this CSV file, as it is very large and will likely take quite a bit of time. How do I get the importer to simply insert null values for the missing data instead of throwing an error?
val2is seen as a row with a single column. To get it to work it would need to beval2,,,,.awkto edit the .csv file.