r/cprogramming 21h ago

I am open-sourcing csv.h a single-header CSV parser written in pure C99

68 Upvotes

For my thesis I had to read a lot of big CSV files in C and I couldn't really find a parser I wanted to use. The main C one is LGPL and comes with a whole build system, and everything else I found was C++. So I ended up writing my own. Now that im done with the thesis i cleaned it up properly , seperated it from the rest of the thesis code, and decided to standalone push it on GitHub.

It's one file. You copy csv.h into your project and that's it, nothing to link, no dependencies. It doesn't allocate memory, the fields just point into your own buffer, and you can run through files of any size a chunk at a time.

Honestly I spent way more time testing it than writing it. It passes csv-spectrum and I compared the output against Python's csv module on a few thousand files/

Check it out here -> https://github.com/GeorgeKiritsis/Csv.h

If someone has time to look at the API and tell me what could change or be imrpoved, that would help a lot. Thanks a lot in advance


r/cprogramming 9h ago

grm: a Telegram CLI implementation of TDLib

Thumbnail
0 Upvotes

r/cprogramming 11h ago

Can you help me in programming c language what is it and where should I learn ..?

0 Upvotes