{"id":18890723,"url":"https://github.com/devwurm/csv-library","last_synced_at":"2026-02-25T17:30:18.377Z","repository":{"id":29889113,"uuid":"33434575","full_name":"DevWurm/csv-library","owner":"DevWurm","description":"A simple stream or object based csv parsing and creating library for C++.","archived":false,"fork":false,"pushed_at":"2015-06-22T08:34:21.000Z","size":160,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-31T06:13:59.841Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DevWurm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license/gpl-3.0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-05T08:04:06.000Z","updated_at":"2020-03-18T17:08:21.000Z","dependencies_parsed_at":"2022-08-23T04:50:31.078Z","dependency_job_id":null,"html_url":"https://github.com/DevWurm/csv-library","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevWurm%2Fcsv-library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevWurm%2Fcsv-library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevWurm%2Fcsv-library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevWurm%2Fcsv-library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevWurm","download_url":"https://codeload.github.com/DevWurm/csv-library/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239861893,"owners_count":19709316,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T07:57:09.549Z","updated_at":"2026-02-25T17:30:18.217Z","avatar_url":"https://github.com/DevWurm.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# csv_library\nA simple stream or object based csv parsing and creating library for C++.\nWith the library you can stream an CSV File into an object or you add\na CSV line as string into the object and get a deque object with the parsed data.\nThe data can get streamed out of the object or yout get a copy of the data from a member function.\nThe same way you can stream or add a deque with data into an object and get a CSV string.\n\n##Library\nBecause the code is based on templates, the library is directory with C++ header files, that is generated by\nmake. Copy the directory into your project and include the libcsv.h file into your project files.\n\n##How to use\n\n    #include \"./libcsv/libcsv.h\" //include the header\n    #include \u003ciostream\u003e\n    #include \u003cfstream\u003e\n    #include \u003cdeque\u003e\n    #include \u003cstring\u003e\n    int main() {\n      csv::csv_handler\u003cint\u003ehandler; //create a handler object for int\n\t\t\t\t\t\t\t\t\t //(from namespace csv)\n      std::ifstream input(\"file.csv\"); //open input file\n      std::ofstream output(\"file2.csv\"); //open output file\n      std::deque\u003cint\u003e data; //deque object to store data (is used like vector)\n      std::string buffer;\n\n      //stream version\n      input \u003e\u003e handler \u003e\u003e data; //read one line from input and store\n\t\t\t\t\t\t       //parsed data in data\n      data \u003e\u003e handler \u003e\u003e output; //write the data from data into on one\n\t\t\t\t\t\t\t\t //line of output\n\n      //possible [but not very useful]: stream one line from input through data\n      //into output and add a newline\n      input \u003e\u003e handler \u003e\u003e data \u003e\u003e handler \u003e\u003e output \u003c\u003c std::endl;\n\n      //member function version\n      getline(input, buffer); //read one line from input into buffer\n      handler.set_csv_line(buffer); //put CSV string into handler (and parse)\n      data = handler.get_parsed_line(); //get parsed data and store in data\n      handler.set_parsed_line(data); //put parsed data into handler\n\t\t\t\t\t\t\t\t\t//(and create CSV string)\n      buffer =  handler.get_csv_line(); //get CSV String and store into buffer\n      output \u003c\u003c buffer; //write buffer into file\n\n    \treturn 0;\n    }\n\n\nYou can use the CSV Handler object as an 'tunnel' between a stream and a variable or another stream, or you can set\nand get data in and from the Handler over public member functions. You can also mix those two ways (conversion is always\ndone at setting data/streaming data into object).\u003cbr\u003e\nYou can also use seperate objects for input/conversion do deque and output/conversion to string (here use ::set_line(DATA)\nand DATA ::getline():\n\n    csv::csv_parser\u003ctype\u003e parser;\n    input \u003e\u003e parser \u003e\u003e data;\n    getline(input, buffer);\n    parser.set_line(buffer);\n    data = parser.get_line();\n\n    csv::csv_creator\u003ctype\u003e creator;\n    data \u003e\u003e creator \u003e\u003e output;\n    parser.set_line(data);\n    buffer = parser.get_line();\n    output \u003c\u003c buffer;\nThe data stored in the csv object are deleted from there after get()ting them or streaming them out of the object.\nThe csv objects work with all instances and derivations of ostream and istream.\n##License\nCopyright 2015 DevWurm\u003cbr\u003e\n'csv_library' is offered under GPL 3 License (Read ./license/gpl-3.0.txt)\n\n##Documentation\nDocumentation will be offered soon. (Email me if you have any questions)\n\n##Setup\n\u003cb\u003eBuilding:\u003c/b\u003e\u003cbr\u003e\nTo build the library file change into the top directory of the project and use make\nwith\n\u003cpre\u003e\u003ccode\u003emake\u003c/code\u003e\u003c/pre\u003e\non linux or\n\u003cpre\u003e\u003ccode\u003emingw32-make\u003c/code\u003e\u003c/pre\u003e,\non windows (only if mingw is installed).\n\u003cb\u003eUsing:\u003c/b\u003e\u003cbr\u003e\nInclude the libcsv.h header file into your source file(s)\n\u003cpre\u003e\u003ccode\u003e#include \"libcsv.h\"\u003c/code\u003e\u003c/pre\u003e\nThen you can use the objects and their members.\n\u003cbr\u003e\nAll the Element functions are showed in the how to use section.\n\n##Authors\nDevWurm\u003cbr\u003e\nEmail: \u003ca href='mailto:devwurm@gmx.net'\u003edevwurm@gmx.net\u003c/a\u003e\u003cbr\u003e\nFeel free to contact me, if you have any questions or ideas about the project :)\n\n##Collaborating\nYou can use the GitHub issue tracker for bugs and feature requests or create a pull request to submit\nchanges and forks are welcome, too.\nIf you don't want to use these possibilities, you can also write me an email at\n\u003ca href='mailto:devwurm@gmx.net'\u003edevwurm@gmx.net\u003c/a\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevwurm%2Fcsv-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevwurm%2Fcsv-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevwurm%2Fcsv-library/lists"}