Socket
Book a DemoInstallSign in
Socket

zsplit-cli

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zsplit-cli

0.4.0
Source
Cargo
Version published
Maintainers
1
Created
Source

zsplit

GPL 3.0 License Workflow Status Crates.io crev reviews

Split text into multiple files by line.

Usage

$ zsplit --help
zsplit 0.4.0
ZSchoen <dev@zschoen.dev>
Split text into multiple files by line

USAGE:
    zsplit [OPTIONS] <SOURCE> <DESTINATIONS>...

ARGS:
    <SOURCE>             The file which should be splitted. Use '-' for piping the content to
                         zsplit
    <DESTINATIONS>...    A list of destinations for the splitted contents

OPTIONS:
    -d, --distributions <DISTRIBUTIONS>...
            Defines how many lines are assigned to a destination. The distributions have to be in
            the same order as the destinations. It defaults to 1

    -f, --line-factor <LINE_FACTOR>
            A factor to multiply the grouping size of the distribution [default: 1]

    -h, --help
            Print help information

    -V, --version
            Print version information

It splits the input into single lines and writes them Round Robin like to the output files.

Examples

Setup

$ seq 0 9 >test_folder/ten.txt; cat test_folder/ten.txt
0
1
2
[...]
8
9

Simple

$ zsplit test_folder/ten.txt test_folder/{a,b,c}
$ cat test_folder/a
0
3
6
9
$ cat test_folder/b
1
4
7
$ cat test_folder/c
2
5
8

Visualisation of simple

Unsymmetric Distribution

$ zsplit test_folder/ten.txt test_folder/{a,b,c} --distribution 3 3 # The last distribution value is implicitly 1
$ cat test_folder/a
0
1
2
7
8
9
$ cat test_folder/b
3
4
5
$ cat test_folder/c
6

Visualisation of unsymmetric distribution

Multiple Lines

$ zsplit test_folder/ten.txt test_folder/{a,b,c} --line-factor 2
$ cat test_folder/a
0
1
6
7
$ cat test_folder/b
2
3
8
9
$ cat test_folder/c
4
5

Visualisation of multiple lines

Installation

Cargo

$ cargo install zsplit-cli

CREV - Rust code reviews - Raise awareness

Please, spread this info !
Open source code needs a community effort to express trustworthiness.
Start with reading the reviews of the crates you use. Example: web.crev.dev/rust-reviews/crate/num-traits/
Than install the CLI cargo-crev. Read the Getting Started guide.
On your Rust project, verify the trustworthiness of all dependencies, including transient dependencies with cargo crev verify
Write a new review !
Describe the crates you trust. Or warn about the crate versions you think are dangerous.
Help other developers, inform them and share your opinion.
Use the helper on this webpage: web.crev.dev/rust-reviews/review_new

FAQs

Package last updated on 23 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.