Parse CSV, ignoring commas inside string literals in VBA?

后端 未结 11 1908
青春惊慌失措
青春惊慌失措 2020-12-30 03:27

I have a VBA application that runs every day. It checks a folder where CSVs are downloaded automatically, and adds their contents to a database. When parsing them, I reali

11条回答
  •  余生分开走
    2020-12-30 04:12

    A simple regex for parsing a CSV line, assuming no quotes inside quoted fields, is:

    "[^"]*"|[^,]*
    

    Each match will return a field.

提交回复
热议问题