Clean up a csv file in C [duplicate] - c

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Is there a library I can use to parse CSV files in C. I am on a Linux system. I know about this but it is in C++ and I need something in C. Don't want to go through the pain of debugging and testing if someone has already done it.

Take a look at libcsv, which is a CSV library written in ANSI C89.

There's a simple CSV parser library that's described in the excellent book The Practice of Programming by
Kernighan and Pike, and the source is available from the site linked to.

Parsing a CSV is no too much complicated, depend of the CSV structure, take a look at the strtok function.

Related

Does anyone know an API for decoding strings like cron does in C? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm a newbie in C and i want to read a file which lines are like 30 7 * * 14-15 and parse to date structures.
So i would really use your help to find an API or an algorithm to do it.
Try to read sources, for example concerning freebsd, fetch os sources (if not aredy done as part of standart os upgrade procedure) , find cron, see sources, take what you need. It is not so unreal as seems.
Sources well documented at comments:
https://svnweb.freebsd.org/base/stable/9/usr.sbin/cron/cron/database.c?revision=225736&view=markup
UPD: link suggested in comment by #PeterT (more exactly for parsing entry):
https://svnweb.freebsd.org/base/stable/9/usr.sbin/cron/lib/entry.c?view=markup#l88

Parse CSV file in C [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Is there a library I can use to parse CSV files in C. I am on a Linux system. I know about this but it is in C++ and I need something in C. Don't want to go through the pain of debugging and testing if someone has already done it.
Take a look at libcsv, which is a CSV library written in ANSI C89.
There's a simple CSV parser library that's described in the excellent book The Practice of Programming by
Kernighan and Pike, and the source is available from the site linked to.
Parsing a CSV is no too much complicated, depend of the CSV structure, take a look at the strtok function.

Looking for Scid's opening book viewer [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I'm trying to implement a chess bot using an opening library.
I've downloaded an opening book file (opening.bin) from Scid.
Is there a viewer utility available for download ?
Sorry for answering the question late. Basically, you should use polyglot for opening the .bin file. The .bin format is a format invented by Polyglot's author, and it makes sense to use his code to open it. Take a look of polyglot's source, book.cpp, it has everything you need even selecting a random move. Alternatively, you could study the source code for Fruit and Stockfish, both chess engines use the .bin opening books.
In general, don't ask chess questions on stackoverflow, ask on talkchess.com.

Parsing JSON using C? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
There are several C libraries available for parsing JSON, that will compile on Linux. Which library would you recommend?
Just to close the loop:
For the project in question, we ended up going with cJSON. We chose this one from the list of C libraries linked from json.org. Per the homepage, cJSON is:
An ultra-lightweight, portable, single-file, simple-as-can-be ANSI-C compliant JSON parser, under MIT license.
This happened to be a good fit for the particular project at hand, and the library worked out fine.
I've seen YAJL used with MGTwitterEngine (Mac/Cocoa), so I assume it is ok.
I haven't done much with it apart from compiling it and pointing MGTwitterEngine on Mac to its library/header files.
Check out the list at json.org. There are several C libraries for JSON.

Best stats library for C (not C++) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Anyone know of a good statistics library for C? I'm looking for something that is commonly used and not a small project. EDIT: must be free!
gsl (http://www.gnu.org/software/gsl/) is widely available, portable, and has a lot of nice functionality.
Statistics are frequently done in other languages, but some of those languages will be callable from C. I'd recommend looking at R and Octave; the latter is an open source Matlab work-alike. Both are programming languages in their own right, but many other languages can be called from C.
In my opinion, MATLAB is a very good choice you can use for that. Here is an article on how to call MATLAB from C.
It ain't cheap. But you did not specify anything about the library being cheap or free. Plus, you are mentioning it's a big project.... :-)

Resources