Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Feature request - "max split" functionality for xsv split #351

@mxr

Description

@mxr

Hello, thanks for this great tool. For my use case, I want to split a file into two chunks - a small chunk and a large chunk. The small chunk serves as "canary" to verify an operation. Once verified, I can repeat the operation with the large chunk.

I looked into doing this with xsv split, however it will split the file into $$n$$ chunks of size $$m$$, whereas I'm looking to split the file into two chunks (one of size $$m$$ and the other of size $$m \times (n-1)$$). Although I can re-join the $$n-1$$ chunks using xsv cat rows, this is a bit finicky.

Looking at other languages, Python's str.split has a maxsplit argument, Go has strings.SplitN, and Rust has str.splitn. Would you consider a similar argument to xsv split? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions