{"id":15032218,"url":"https://github.com/thealgorythm/zsplit","last_synced_at":"2025-04-10T00:21:40.074Z","repository":{"id":44598798,"uuid":"433468975","full_name":"TheAlgorythm/zsplit","owner":"TheAlgorythm","description":"Split text into multiple files by line","archived":false,"fork":false,"pushed_at":"2024-04-08T14:02:08.000Z","size":207,"stargazers_count":2,"open_issues_count":5,"forks_count":0,"subscribers_count":3,"default_branch":"MAIN","last_synced_at":"2024-04-09T05:39:54.298Z","etag":null,"topics":["cli","coreutils","rust","split","text","utility"],"latest_commit_sha":null,"homepage":"https://zschoen.dev/projects/zsplit","language":"Rust","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/TheAlgorythm.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}},"created_at":"2021-11-30T14:47:51.000Z","updated_at":"2024-04-15T06:29:41.887Z","dependencies_parsed_at":"2023-02-09T13:31:07.537Z","dependency_job_id":"c165ab03-d8a6-42a7-b756-1a1dcfb67d79","html_url":"https://github.com/TheAlgorythm/zsplit","commit_stats":{"total_commits":52,"total_committers":2,"mean_commits":26.0,"dds":0.05769230769230771,"last_synced_commit":"6f7f21268d9141c7ac5c184f7fef880a792bdc89"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlgorythm%2Fzsplit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlgorythm%2Fzsplit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlgorythm%2Fzsplit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlgorythm%2Fzsplit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheAlgorythm","download_url":"https://codeload.github.com/TheAlgorythm/zsplit/tar.gz/refs/heads/MAIN","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248132123,"owners_count":21052977,"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":["cli","coreutils","rust","split","text","utility"],"created_at":"2024-09-24T20:17:46.170Z","updated_at":"2025-04-10T00:21:40.063Z","avatar_url":"https://github.com/TheAlgorythm.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zsplit\n\n![GPL 3.0 License](https://img.shields.io/crates/l/zsplit-cli?style=for-the-badge\u0026logo=open-source-initiative)\n[![Workflow Status](https://img.shields.io/github/actions/workflow/status/TheAlgorythm/zsplit/check.yml?branch=MAIN\u0026style=for-the-badge)](https://github.com/TheAlgorythm/zsplit/actions?query=workflow%3ARust)\n[![Crates.io](https://img.shields.io/crates/v/zsplit-cli?style=for-the-badge\u0026logo=rust)](https://crates.io/crates/zsplit-cli)\n[![crev reviews](https://web.crev.dev/rust-reviews/badge/crev_count/zsplit-cli.svg)](https://web.crev.dev/rust-reviews/crate/zsplit-cli/)\n\nSplit text into multiple files by line.\n\n## Usage\n\n```console\n$ zsplit --help\nzsplit 0.4.0\nZSchoen \u003cdev@zschoen.dev\u003e\nSplit text into multiple files by line\n\nUSAGE:\n    zsplit [OPTIONS] \u003cSOURCE\u003e \u003cDESTINATIONS\u003e...\n\nARGS:\n    \u003cSOURCE\u003e             The file which should be splitted. Use '-' for piping the content to\n                         zsplit\n    \u003cDESTINATIONS\u003e...    A list of destinations for the splitted contents\n\nOPTIONS:\n    -d, --distributions \u003cDISTRIBUTIONS\u003e...\n            Defines how many lines are assigned to a destination. The distributions have to be in\n            the same order as the destinations. It defaults to 1\n\n    -f, --line-factor \u003cLINE_FACTOR\u003e\n            A factor to multiply the grouping size of the distribution [default: 1]\n\n    -h, --help\n            Print help information\n\n    -V, --version\n            Print version information\n```\n\nIt splits the input into single lines and writes them Round Robin like to the output files.\n\n### Examples\n\n#### Setup\n\n```console\n$ seq 0 9 \u003etest_folder/ten.txt; cat test_folder/ten.txt\n0\n1\n2\n[...]\n8\n9\n```\n\n#### Simple\n\n```console\n$ zsplit test_folder/ten.txt test_folder/{a,b,c}\n$ cat test_folder/a\n0\n3\n6\n9\n$ cat test_folder/b\n1\n4\n7\n$ cat test_folder/c\n2\n5\n8\n```\n\n![Visualisation of simple](docs/simple.svg)\n\n#### Unsymmetric Distribution\n\n```console\n$ zsplit test_folder/ten.txt test_folder/{a,b,c} --distribution 3 3 # The last distribution value is implicitly 1\n$ cat test_folder/a\n0\n1\n2\n7\n8\n9\n$ cat test_folder/b\n3\n4\n5\n$ cat test_folder/c\n6\n```\n\n![Visualisation of unsymmetric distribution](docs/unsymmetric_distribution.svg)\n\n#### Multiple Lines\n\n```console\n$ zsplit test_folder/ten.txt test_folder/{a,b,c} --line-factor 2\n$ cat test_folder/a\n0\n1\n6\n7\n$ cat test_folder/b\n2\n3\n8\n9\n$ cat test_folder/c\n4\n5\n```\n\n![Visualisation of multiple lines](docs/multiple_lines.svg)\n\n## Installation\n\n### Cargo\n\n```console\n$ cargo install zsplit-cli\n```\n\nWhen the installation is done with the MSRV, it could be necessary to add the `--locked` CLI argument as some dependencies may increase their MSRV without a version bump according to SemVer.\n\n## CREV - Rust code reviews - Raise awareness\n\nPlease, spread this info !\\\nOpen source code needs a community effort to express trustworthiness.\\\nStart with reading the reviews of the crates you use. Example: [web.crev.dev/rust-reviews/crate/num-traits/](https://web.crev.dev/rust-reviews/crate/num-traits/) \\\nThan install the CLI [cargo-crev](https://github.com/crev-dev/cargo-crev)\\. Read the [Getting Started guide](https://github.com/crev-dev/cargo-crev/blob/master/cargo-crev/src/doc/getting_started.md). \\\nOn your Rust project, verify the trustworthiness of all dependencies, including transient dependencies with `cargo crev verify`\\\nWrite a new review ! \\\nDescribe the crates you trust. Or warn about the crate versions you think are dangerous.\\\nHelp other developers, inform them and share your opinion.\\\nUse the helper on this webpage: [web.crev.dev/rust-reviews/review_new](https://web.crev.dev/rust-reviews/review_new)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthealgorythm%2Fzsplit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthealgorythm%2Fzsplit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthealgorythm%2Fzsplit/lists"}