Skip to main content

PyPI version

cutpaste

Unix-like cut and paste commands with multi-character delimiter support.

Unlike the standard Unix cut which only supports single-character delimiters, pycut and pypaste can split and join on strings like ::, ->, or any delimiter you need.

Installation

pip install cutpaste

pycut - Extract fields from lines

Extract specific fields from each line of input, using a delimiter.

pycut -d DELIMITER -f FIELDS [FILE...]

Options:

  • -d, --delimiter - String delimiter to split on (default: TAB). Supports escape sequences like \t, \n.
  • -f, --field - Field(s) to extract (required). 1-based indexing.
  • -v, --version - Show version and exit.

Field specification formats:

  • Single field: -f 2 (extract field 2)
  • Multiple fields: -f 1,3,5 (extract fields 1, 3, and 5)
  • Range: -f 2-4 (extract fields 2, 3, and 4)
  • Mixed: -f 1,3-5,7 (extract fields 1, 3, 4, 5, and 7)

Examples:

# Extract the second field from a space-delimited file
pycut -d ' ' -f 2 data.txt

# Extract first and third columns from CSV
pycut -d ',' -f 1,3 data.csv

# Multi-character delimiter - extract second part of "key::value" lines
pycut -d '::' -f 2 config.txt

# Use with pipes
echo "a->b->c" | pycut -d '->' -f 2
# Output: b

# Extract a range of fields
echo "one,two,three,four,five" | pycut -d ',' -f 2-4
# Output: two,three,four

# Read from stdin explicitly
cat file.txt | pycut -d '\t' -f 1 -

pypaste - Merge files line by line

Merge corresponding lines from multiple files, joining them with a delimiter.

pypaste -d DELIMITER [FILE...]

Options:

  • -d, --delimiter - String delimiter to join with (default: TAB). Supports escape sequences like \t, \n.
  • -v, --version - Show version and exit.

Examples:

# Merge two files with tab delimiter (default)
pypaste names.txt ages.txt

# Merge with comma delimiter
pypaste -d ',' col1.txt col2.txt col3.txt

# Multi-character delimiter
pypaste -d ' | ' left.txt right.txt

# Use stdin as one of the inputs
seq 5 | pypaste -d ',' - letters.txt

Streaming

Both commands process input line-by-line without loading entire files into memory. This means they work efficiently with:

  • Large files
  • Piped input
  • Infinite streams

License

MIT

Metadata

Release files for cutpaste 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cutpaste 0.0.3
File Size Uploaded Provenance
cutpaste-0.0.3.tar.gz 3.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cutpaste 0.0.3
File Interpreter ABI Platform
cutpaste-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 8.6 kB

Release files / cutpaste-0.0.3.tar.gz

Download URL cutpaste-0.0.3.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
43a21be6534728bb708562298e66bd418716ba269e211186d7317efe24f4139f
BLAKE2b-256 checksum
How to use checksums
c384945f18dc637f1b0f91847efecaf6e8875c85f0f32eac706ebf0c3e7accaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / cutpaste-0.0.3-py3-none-any.whl

Download URL cutpaste-0.0.3-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
150e851ccbb45c2e8e32a89240a3d8cf58f4d1c6ce67bf54b47fc865e6297372
BLAKE2b-256 checksum
How to use checksums
9f2e5becd7b11b1949c2bdc102e8ad9941492fc610603cde79769bc5b488bff3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for cutpaste 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page