{"id":22354279,"url":"https://github.com/jonmagic/csvdiff","last_synced_at":"2025-03-26T12:40:37.404Z","repository":{"id":10259414,"uuid":"12369369","full_name":"jonmagic/csvdiff","owner":"jonmagic","description":"A csv differ implemented in Go.","archived":false,"fork":false,"pushed_at":"2013-08-26T02:18:55.000Z","size":104,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T13:43:46.370Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/jonmagic.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}},"created_at":"2013-08-26T02:04:41.000Z","updated_at":"2021-06-29T21:35:39.000Z","dependencies_parsed_at":"2022-09-19T10:20:33.810Z","dependency_job_id":null,"html_url":"https://github.com/jonmagic/csvdiff","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/jonmagic%2Fcsvdiff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonmagic%2Fcsvdiff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonmagic%2Fcsvdiff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonmagic%2Fcsvdiff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonmagic","download_url":"https://codeload.github.com/jonmagic/csvdiff/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245658958,"owners_count":20651517,"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-12-04T13:12:11.993Z","updated_at":"2025-03-26T12:40:37.385Z","avatar_url":"https://github.com/jonmagic.png","language":"Go","readme":"# csvdiff\n\nIn order to compare two csv files and get something more meaningful than normal line diffs you can choose an identifier column in your data that will be used to match rows. If no identifier column is chosen you can of course fall back to the line number as the unique identifier.\n\nOnce a row from two revisions is matched you can compare the values in every other cell in that row and *show the changes in a meaningful way*.\n\nFor text normal red/green comparisons are handy, but things get much more interesting when you *start comparing cells with numerical values as you can show the change in value*. Date and time cells could show a *change in days, hours, minutes, seconds, or all of the above*. If you can determine the column type more meaningful comparisons can be done.\n\nThis repository is my attempt at building a csv differ in Go.\n\n## Usage\n\n```bash\n$ go build csvdiff.go\n\n$ ./csvdiff --help\nusage: csvdiff new_revision.csv old_revision.csv\nexit status 1\n\n$ ./csvdiff revisionX.csv revisionY.csv\nChanged:  [1 jonmagic 1000] [1 jonmagic 2500]\nChanged:  [2 benbalter 9999] [2 benbalter 8888]\nAdded:  [4 caged 6200]\nRemoved:  [3 gjtorikian 8500]\n```\n\n## Output Format\n\nThe output is currently very limited but eventually I hope to return json that looks like this:\n\n```json\n{\n  \"changed\": [\n    {\n      \"rowIndex\": 1,\n      \"cells\": [\n        {\n          \"previous_value\": 1,\n          \"value\": 1,\n          \"type\": \"integer\"\n        },\n        {\n          \"previous_value\": \"jonmagic\",\n          \"value\": \"jonmagic\",\n          \"type\": \"string\"\n        },\n        {\n          \"previous_value\": 1000,\n          \"value\": 2500,\n          \"type\": \"integer\",\n          \"change\": 1500\n        }\n      ]\n    },\n    {\n      \"rowIndex\": 2,\n      \"cells\": [\n        {\n          \"previous_value\": 2,\n          \"value\": 2,\n          \"type\": \"integer\"\n        },\n        {\n          \"previous_value\": \"benbalter\",\n          \"value\": \"benbalter\",\n          \"type\": \"string\"\n        },\n        {\n          \"previous_value\": 9999,\n          \"value\": 8888,\n          \"type\": \"integer\",\n          \"change\": -1111\n        }\n      ]\n    }\n  ],\n  \"added\": [\n    {\n      \"rowIndex\": 3,\n      \"cells\": [\n        {\n          \"value\": 4,\n          \"type\": \"integer\"\n        },\n        {\n          \"value\": \"caged\",\n          \"type\": \"string\"\n        },\n        {\n          \"value\": 6200,\n          \"type\": \"integer\"\n        }\n      ]\n    }\n  ],\n  \"removed\": [\n    {\n      \"rowIndex\": 3,\n      \"cells\": [\n        {\n          \"value\": 3,\n          \"type\": \"integer\"\n        },\n        {\n          \"value\": \"gjtorikian\",\n          \"type\": \"string\"\n        },\n        {\n          \"value\": 8500,\n          \"type\": \"integer\"\n        }\n      ]\n    }\n  ]\n}\n```\n\n## Contributors\n\n* [jonmagic](https://github.com/jonmagic)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonmagic%2Fcsvdiff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonmagic%2Fcsvdiff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonmagic%2Fcsvdiff/lists"}