Skip to content

Save Excel Sheet As CSV

Greg Kostin edited this page Oct 20, 2017 · 2 revisions

Excel Save As CSV

  1. Open the Excel workbook in Excel
  2. Make the sheet you want to save in CSV format the active worksheet
  3. Under the File menu select Save As...
  4. For File Format: select CSV UTF-8 (Comma delimited) (.csv)
  5. Save the file (Select Active Sheet)
  6. Open the CSV file in VIM
  7. Enter the VIM command :%s/\r/\r/g which will wake up VIM to do its' magic on ^M at the end of lines
  8. Navigate your cursor to the first empty (all commas) line and enter d G to delete everything from there to the end of file
  9. Enter the VIM command :set nobomb to have VIM remove the hidden <0xEF,0xBB,0xBF> at the start of the file
  10. Enter the VIM command :wq to save the file and quit

Hex Verification

  1. Open the CSV file in VIM
  2. Enter the VIM command :%!xxd to enter hexadecimal mode
  3. Search for the hidden <0xEF,0xBB,0xBF> via /efbb bf
  4. Enter the VIM command :%!xxd -r to exit hexadecimal mode