{"id":37049169,"url":"https://github.com/barry-jones/csv-validator","last_synced_at":"2026-01-14T05:43:06.074Z","repository":{"id":40870321,"uuid":"68536941","full_name":"barry-jones/csv-validator","owner":"barry-jones","description":"Fast CSV file validation.","archived":false,"fork":false,"pushed_at":"2022-12-08T10:38:24.000Z","size":140,"stargazers_count":15,"open_issues_count":8,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-11-19T00:29:12.168Z","etag":null,"topics":["csv","csv-text","csv-validator","delimited","delimited-files","delimiter","dotnet","netcore","text","validation","validations","validator"],"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/barry-jones.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-18T17:40:04.000Z","updated_at":"2025-01-16T04:12:46.000Z","dependencies_parsed_at":"2023-01-25T02:45:49.641Z","dependency_job_id":null,"html_url":"https://github.com/barry-jones/csv-validator","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/barry-jones/csv-validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barry-jones%2Fcsv-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barry-jones%2Fcsv-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barry-jones%2Fcsv-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barry-jones%2Fcsv-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barry-jones","download_url":"https://codeload.github.com/barry-jones/csv-validator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barry-jones%2Fcsv-validator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28411174,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["csv","csv-text","csv-validator","delimited","delimited-files","delimiter","dotnet","netcore","text","validation","validations","validator"],"created_at":"2026-01-14T05:43:05.543Z","updated_at":"2026-01-14T05:43:06.066Z","avatar_url":"https://github.com/barry-jones.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSV Validator\n\n[![](https://img.shields.io/github/release/barry-jones/csv-validator.svg)](https://github.com/barry-jones/csv-validator/releases/tag/v1.0.4)\n[![Version](https://img.shields.io/nuget/vpre/CsvValidator.svg)](https://www.nuget.org/packages/CsvValidator)\n\n.NET Core CSV text file validator. Enables the quick verification of column separated data files. Columns can be checked against multiple requirements for correctness.\n\nThis application is provided via a CLI and a NuGet package. Details for using both are provided below.\n\n## CLI Usage\n\nThe application is command line based, and has two arguments:\n\n``` bash\nvalidate --file \"input-datafile.csv\" --with \"configuration.json\"\n```\n\n## Configuration\n\nTo configure the verification a JSON file is used with the following format:\n\n``` json\n{\n\t\"rowSeperator\": \"\\r\\n\",\n\t\"columnSeperator\": \",\",\n\t\"hasHeaderRow\": true,\n\t\"columns\": {\n\t\t\"1\": {\n\t\t\t\"name\": \"ID\",\n\t\t\t\"isRequired\": true,\n\t\t\t\"unique\": true\n\t\t},\n\t\t\"2\": {\n\t\t\t\"name\": \"DOB\",\n\t\t\t\"pattern\": \"^\\\\d\\\\d\\\\d\\\\d-\\\\d\\\\d-\\\\d\\\\d$\"\n\t\t},\n\t\t\"3\": {\n\t\t\t\"name\": \"NOTES\",\n\t\t\t\"maxLength\": \"250\"\n\t\t}\n\t}\n}\n```\n\nThe `pattern` property uses regular expressions but it is important to escape the characters else the application will fail when reading the configuration file.\n\n`rowSeperator` can be any number of characters, rows can also be separated by characters and do not need the new line characters to be available in the input file.\n\n`columnSeperator` can be one or more characters.\n\nThe columns __require__ the number, which is the ordinal of the column in the input file, you do not need to specify all columns, only those that are to be validated.\n\n### Supported validation\n\n```\n{\n    // validates the column has content\n    \"isRequired\": true|false,\n    // validates the content is unique in this column across the full file\n    \"unique\": true|false,\n    // validates a string against a regular expression\n    \"pattern\": \"regular expression string\",\n    // Maximum allowable length for a column\n    \"maxLength\": \"int\",\n    // Check if content is numerical\n    \"isNumeric\": true|false\n}\n```\n\n## API Usage\n\nCSV Validator is also available as a NuGet package, to enable in application validation of text files. The API conforms to _netstandard 2.0_.\n\n### Installation\n\n``` cli\ndotnet add package csvvalidator\n```\n\n``` xml\n\u003cItemGroup\u003e\n  \u003cPackageReference Include=\"csvvalidator\" Version=\"1.0.1\" /\u003e\n\u003c/ItemGroup\u003e\n```\n\n### Usage\n\n``` csharp\nValidator validator = Validator.FromJson(config);\nRowValidationError[] errors = validator.Validate(inputStream);\n```\n\n__Dealing with validation errors.__\n\nErrors are reported heirarchicly, by row and then columns.\n\n``` csharp\nforeach(RowValidationError current in errors) \n{\n\t// row errors provides details of the row number and the content\n\tConsole.WriteLine($\"Errors in row[{current.Row}]: {current.Content}\");\n\tforeach(ValidationError error in current.Errors)\n\t{\n\t\t// all errors then that occur on that row are reported in the error collection\n\t\tConsole.WriteLine($\"{error.Message} at {error.AtCharacter}\");\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarry-jones%2Fcsv-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarry-jones%2Fcsv-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarry-jones%2Fcsv-validator/lists"}