Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A field selection command-line tool

Project Description

# sel

sel is an inline field selection and table transformation tool that aims to replace cut.

pip install sel

## Simple

Selecting a field from a line requires a single character:

$ echo a b c d e | sel 3 c

sel understands field ranges, in python style:

$ echo “a b c d e” | sel 2:4 b c d

$ echo “a b c d e” | sel 2:-2 b c d

$ echo “a b c d e” | sel 3: c d e

## Flexible

By default, sel splits the input on whitespace. It can also use a custom string or regular expression:

$ cat users.csv 1241,Bob 3192,MitM 3255,Alice

$ cat users.csv | sel 1 –delim , 1241 3192 3255

$ echo 1a2b3c4d | sel –regex [a-z] 2:3 2 3

## Powerful

sel works well on multiline input, and can take advantage of table headers if present. It can also produce tabular outputs.

$ ps aux | sel 1 –skip-header root user1 user2

$ ps aux | sel –align %MEM PID COMMAND PID COMMAND %MEM 2414 /opt/google/chrome/chrome 1.7 5272 /opt/sublime_text_2/sublime_text 1.6 4662 /usr/bin/python3 1.5 2470 /opt/google/chrome/chrome 1.5

Release History

Release History

This version
History Node

0.2.2

History Node

0.2.1

History Node

0.2

History Node

0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
sel-0.2.2.tar.gz (3.3 kB) Copy SHA256 Checksum SHA256 Source Mar 7, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting