{"id":15539660,"url":"https://github.com/thchang/csvtomatrix","last_synced_at":"2025-03-28T23:43:48.947Z","repository":{"id":157742145,"uuid":"318366004","full_name":"thchang/CSVtoMatrix","owner":"thchang","description":"Import a matrix from a CSV into a C array, and store in row-major ordering.","archived":false,"fork":false,"pushed_at":"2020-12-04T02:17:51.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-09T12:58:55.460Z","etag":null,"topics":["c","csv"],"latest_commit_sha":null,"homepage":"","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/thchang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-04T01:18:27.000Z","updated_at":"2020-12-04T02:41:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"97cec65e-9742-4415-abea-0d911a9e83f2","html_url":"https://github.com/thchang/CSVtoMatrix","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/thchang%2FCSVtoMatrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thchang%2FCSVtoMatrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thchang%2FCSVtoMatrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thchang%2FCSVtoMatrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thchang","download_url":"https://codeload.github.com/thchang/CSVtoMatrix/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246117690,"owners_count":20726068,"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":["c","csv"],"created_at":"2024-10-02T12:11:02.943Z","updated_at":"2025-03-28T23:43:48.928Z","avatar_url":"https://github.com/thchang.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSVtoMatrix\n\nOne day I needed to load a matrix from a CSV file into a C array.\nI looked around the internet to borrow someone else's solution, but\nI couldn't easily find an existing solution for this simple and\ncommon task, which I think is surprising. (I'm sure someone has\nposted about this before, I just couldn't easily find it). So I \nwrote my own solution. Maybe the next guy/gal will find this and\nsave an hour :)\n\nNote, there is no support for white spaces, this is just a simple demo...\n\n```\n/*\n * Function: readCSV\n * -----------------\n * read a nXm matrix from a CSV file into a flat array in row-major ordering\n *\n * n: the number of rows\n *\n * m: the number of cols\n *\n * fp: pointer to FILE object for the CSV file containing (one row per line)\n *\n * mat: pointer to a block of memory of size sizeof(double)*n*m, into which\n *      the matrix will be loaded on output\n */\nvoid readCSV(int n, int m, FILE *fp, double *mat)\n```\n\n## Contents\n\nThere are 4 files:\n * `README.md` is this file\n * `readCSV.c` is the source file\n * `matrix.csv` is a sample matrix\n * `Makefile` is a sample GNU makefile\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthchang%2Fcsvtomatrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthchang%2Fcsvtomatrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthchang%2Fcsvtomatrix/lists"}