Fully featured CSV parser for Haskell?

后端 未结 5 1670
长发绾君心
长发绾君心 2021-02-07 05:26

Can anybody recommend a way to parse CSV files with options to:

  • set cells/fields separator
  • set end of record/row terminator
  • set quote-character f
5条回答
  •  后悔当初
    2021-02-07 05:52

    I can't recommend a ready-to-go, packaged-up CSV parser for Haskell, but I remember that the book Real-World Haskell by Bryan O'Sullivan et al. contains a chapter on Parsec, which the authors demonstrate by creating a CSV parser.

    The relevant chapter 16: Using Parsec is available online; check the section titled Extended Example: Full CSV Parser.

提交回复
热议问题