{"id":15385269,"url":"https://github.com/stevehansen/csv","last_synced_at":"2025-04-10T06:14:29.264Z","repository":{"id":1636175,"uuid":"42789122","full_name":"stevehansen/csv","owner":"stevehansen","description":"Really simple csv library","archived":false,"fork":false,"pushed_at":"2025-03-30T19:34:09.000Z","size":140,"stargazers_count":205,"open_issues_count":3,"forks_count":44,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-03T03:23:22.087Z","etag":null,"topics":["csharp","csv","netstandard"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stevehansen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2015-09-19T20:47:29.000Z","updated_at":"2025-03-20T18:45:27.000Z","dependencies_parsed_at":"2024-02-06T20:25:07.531Z","dependency_job_id":"39c2e7a7-7bfa-4d0f-8d40-cd7377d08f64","html_url":"https://github.com/stevehansen/csv","commit_stats":{"total_commits":70,"total_committers":12,"mean_commits":5.833333333333333,"dds":0.6142857142857143,"last_synced_commit":"f626544191e79789de23b8086539410fac749219"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevehansen%2Fcsv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevehansen%2Fcsv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevehansen%2Fcsv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevehansen%2Fcsv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevehansen","download_url":"https://codeload.github.com/stevehansen/csv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166925,"owners_count":21058481,"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":["csharp","csv","netstandard"],"created_at":"2024-10-01T14:44:20.857Z","updated_at":"2025-04-10T06:14:29.244Z","avatar_url":"https://github.com/stevehansen.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# csv\nReally simple csv library\n\n## Install\n\nTo install csv, use the following command in the Package Manager Console\n\n    PM\u003e Install-Package Csv\n\n## Basic Usage\n\n_More examples can be found in the tests._\n\n### Reading a CSV file\n\n```csharp\n// NOTE: Library assumes that the csv data will have a header row by default, see CsvOptions.HeaderMode\n/*\n# comments are ignored\nColumn name,Second column,Third column\nFirst cell,second cell,\nSecond row,second cell,third cell\n*/ \nvar csv = File.ReadAllText(\"sample.csv\");\nforeach (var line in CsvReader.ReadFromText(csv))\n{\n    // Header is handled, each line will contain the actual row data\n    var firstCell = line[0];\n    var byName = line[\"Column name\"];\n}\n```\n\n`CsvReader` also supports reading from a `TextReader` (`CsvReader.Read(TextReader, CsvOptions)`) or a `Stream` (`CsvReader.ReadFromStream(Stream, CsvOptions)`)\n\n`CsvOptions` can be used to configure the csv parsing:\n\n```csharp\nvar options = new CsvOptions // Defaults\n{\n    RowsToSkip = 0, // Allows skipping of initial rows without csv data\n    SkipRow = (row, idx) =\u003e string.IsNullOrEmpty(row) || row[0] == '#',\n    Separator = '\\0', // Autodetects based on first row\n    TrimData = false, // Can be used to trim each cell\n    Comparer = null, // Can be used for case-insensitive comparison for names\n    HeaderMode = HeaderMode.HeaderPresent, // Assumes first row is a header row\n    ValidateColumnCount = false, // Checks each row immediately for column count\n    ReturnEmptyForMissingColumn = false, // Allows for accessing invalid column names\n    Aliases = null, // A collection of alternative column names\n    AllowNewLineInEnclosedFieldValues = false, // Respects new line (either \\r\\n or \\n) characters inside field values enclosed in double quotes.\n    AllowBackSlashToEscapeQuote = false, // Allows the sequence \"\\\"\" to be a valid quoted value (in addition to the standard \"\"\"\")\n    AllowSingleQuoteToEncloseFieldValues = false, // Allows the single-quote character to be used to enclose field values\n    NewLine = Environment.NewLine // The new line string to use when multiline field values are read (Requires \"AllowNewLineInEnclosedFieldValues\" to be set to \"true\" for this to have any effect.)\n};\n```\n\n### Writing a CSV file\n\n```csharp\nvar columnNames = new [] { \"Id\", \"Name\" };\nvar rows = new [] \n{\n    new [] { \"0\", \"John Doe\" },\n    new [] { \"1\", \"Jane Doe\" }\n};\nvar csv = CsvWriter.WriteToText(columnNames, rows, ',');\nFile.WriteAllText(\"people.csv\", csv);\n/*\nWrites the following to the file:\n\nId,Name\n0,John Doe\n1,Jane Doe\n*/\n```\n\n\n## Build status\n[![Build status](https://ci.appveyor.com/api/projects/status/d1m0vu1n7idsk7uu?svg=true)](https://ci.appveyor.com/project/SteveHansen/csv)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fstevehansen%2Fcsv.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fstevehansen%2Fcsv?ref=badge_shield)\n[![codecov](https://codecov.io/gh/stevehansen/csv/branch/master/graph/badge.svg)](https://codecov.io/gh/stevehansen/csv)\n\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fstevehansen%2Fcsv.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fstevehansen%2Fcsv?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevehansen%2Fcsv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevehansen%2Fcsv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevehansen%2Fcsv/lists"}