0

I am trying to create a CSV file off an excel file. the problem is, whenever I create the CSV file, it treats every cell in the header/trailer as a cell with information in it.

What do i do to prevent those extra trailing , (commas) in the csv?
Sample excel file:
sample excel file

Here is what the delimited file looks like. I don't want all those extra commas.

td,sd,HDR,020321,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
20210130,20210202,2610081743,2610081743,PSHG,2610081743,,,C,595017BH7,PB 1234
20210130,20210202,2612230531,2612230531,PSHG,2612230531,,,C,02156BEE5,PB 45657
20210130,20210202,3101140730,3101140730,PSHG,3101140730,,,S,EXGA,PB 8910
20210130,20210202,3210231839,3210231839,PSHG,3210231839,,,S,SITP,PB 1111
20210130,20210202,3210231935,3210231935,PSHG,3210231935,,,S,EU000A285,PB 2222
,,TLR,5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
ZygD
  • 22,092
  • 39
  • 79
  • 102
  • I'm not sure what your question is here. the first and final row need all those commas to denote that the columns are empty. There _should_ be 1 comma per column regardless of their content. – Joshua Feb 04 '21 at 03:48
  • but i want an end of line type notifier so that those extra commas get produced. – jimbo10583 Feb 04 '21 at 14:33
  • then you're not wanting a CSV, you're wanting a custom file type CSV is literally _Comma_ Separated Values. So all columns are seperated by commas. If you want something that looks cleaner there's TSV (tab seperated) but it still wont be _empty_ it'll just _look_ empty if opened. – Joshua Feb 04 '21 at 23:33

0 Answers0