{"id":20294300,"url":"https://github.com/staudtlex/csvtools","last_synced_at":"2025-07-09T11:07:35.846Z","repository":{"id":132218818,"uuid":"425548239","full_name":"staudtlex/csvtools","owner":"staudtlex","description":"combine-csv merges CSV-formatted files into a single file. CSV files need not have the same number of columns, column names need not be unique.","archived":false,"fork":false,"pushed_at":"2022-02-11T18:44:25.000Z","size":830,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-07T15:04:52.533Z","etag":null,"topics":["csv","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/staudtlex.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":"2021-11-07T15:58:15.000Z","updated_at":"2021-12-12T16:16:01.000Z","dependencies_parsed_at":"2024-03-30T18:47:34.856Z","dependency_job_id":null,"html_url":"https://github.com/staudtlex/csvtools","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/staudtlex/csvtools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staudtlex%2Fcsvtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staudtlex%2Fcsvtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staudtlex%2Fcsvtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staudtlex%2Fcsvtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/staudtlex","download_url":"https://codeload.github.com/staudtlex/csvtools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staudtlex%2Fcsvtools/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264446721,"owners_count":23609633,"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":["csv","java"],"created_at":"2024-11-14T15:28:45.862Z","updated_at":"2025-07-09T11:07:35.825Z","avatar_url":"https://github.com/staudtlex.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# combine-csv\n\n_combine-csv_ is a Java tool to combine CSV-formatted files into a single file. CSV files need not have the same number of columns, column names need not be unique.\n\n## Dependencies\n\n- OpenJDK (version 8 or higher)\n- Maven (or GNU make)\n- Apache Commons CSV (see [https://commons.apache.org/proper/commons-csv/](https://commons.apache.org/proper/commons-csv/))\n- Apache Commons CLI (see [https://commons.apache.org/proper/commons-cli/](https://commons.apache.org/proper/commons-cli/))\n- JUnit ConsoleLauncher (required for testing only; see [https://junit.org/junit5/docs/current/user-guide/#running-tests-console-launcher](https://junit.org/junit5/docs/current/user-guide/#running-tests-console-launcher))\n\n## Build and test\n\nCreate regular, executable jar:\n\n- `mvn package` (or `make jar`)\n\nAlternatively, create an executable uber-jar (which also contains its runtime dependencies):\n\n- `mvn package assembly:single` (or `make uber-jar`)\n\nTest the package:\n\n- `mvn test` (or `make test`)\n\nGenerate the package information and class documentation:\n\n- `mvn site` (for more information, see the [Maven site-plugin](https://maven.apache.org/plugins/maven-site-plugin/usage.html) and the [Maven javadoc-plugin](https://maven.apache.org/plugins/maven-javadoc-plugin/usage.html))\n\nThe documentation is located in `./target/site/index.html` in the project directory.\n\n## Usage\n\n```sh\nusage: combineCsv [-h] [-r \u003ccustom-order\u003e] \u003cfile-1 file-2 ...\u003e\n\nOptions:\n -h,--help            Display this help message\n -r,--reorder \u003carg\u003e   Reorder columns according to comma-separated list of\n                      column names\n```\n\n`combine-csv-1.2.0.jar` takes as arguments at least two CSV files that are to be combined. The result is printed to `stdout`. Users may optionally provide a comma-separated string to reorder the column names via the `-r` option (also see [column ordering](#column-ordering)).\n\nLet us assume `combine-csv-1.2.0.jar` is located in the working directory, and the CSV files are located in `./csv-dir`. \n\nDepending on whether we created a regular or an uber-jar, the commands for merging CSV files may slightly differ.\n\nUsing the regular jar, run\n```sh\njava -cp path/to/commons-csv.jar:path/to/commons-cli.jar/combine-csv-1.2.0.jar de.staudtlex.csvtools.CombineCsv csv-dir/*.csv \u003e results.csv\n```\n\nWith the uber-jar, run\n```sh\njava -jar combine-csv-1.2.0.jar csv-dir/*.csv \u003e results.csv\n``` \n\nDepending on the size and number of CSV files, this process may take some time. \n\n## Column ordering\nBy default, _combine-csv_ orders column names according to their order of appearance in the first file in which they present:\n\n- Given two files with column names `a,b` and `b,a`, the resulting order will be `a,b`\n\n- Given three files with column names `a,b`, `y,x`, and `d,e,x,y`, the resulting order will be `a,b,y,x,d,e`\n\nAssuming we want the resulting CSV to have columns to be ordered alphabetically, call _combine-csv_ with the `-r` option and provide the required column ordering\n\n```sh\njava -jar combine-csv-1.2.0.jar -r a,b,d,e,x,y csv-dir/*.csv \u003e results.csv\n``` ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaudtlex%2Fcsvtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstaudtlex%2Fcsvtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaudtlex%2Fcsvtools/lists"}