Name
field - extract fields from a file
SYNOPSIS
field [-h] [-f FILE] [-d DELIMITER] [FIELD ...]
DESCRIPTION
field extracts a list of fields from a file. It is a simpler version of:
awk '{ print $5,$3,$1; }'
and similar scripts. Whitespace delimited (space and tab) fields are read from stdin and written to stdout.
FIELD is assumed to be 1-indexed integer, separated by commas and/or spaces, and take the following form:
N a single field.
N-M a range of increasing or decreasing fields from N to M.
- -h, –help
show concise list of options and exit
- –version
display version information and exit
- -f, –file FILE
an explicit file to extract fields
- -d, –delimiter DELIMITER
character delimiter between fields
NOTES
Field was written to address two short comings of cut:
Default Behavior
The default delimiter of cut is tab. Most command line utilities produce output delimited by whitespace, which includes spaces. Field takes this into account and defaults the delimiter to both tab and space characters.
Field Ordering
Fields extracted by cut are not listed in the order they are passed.
EXAMPLES
$ mount | field 5 3 1
ext4 / /dev/mapper/sda7_crypt
proc /proc proc
sysfs /sys sysfs
$ ls -l /usr/local/bin/ | field 1 9
-rwxr-xr-x airbrake*
-rwxr-xr-x bayes.rb*
-rwxr-xr-x bourbon*
$ cat /etc/mtab | cut -d' ' -f 4 | field -d',' 1 4 3 2
rw gid=5 nosuid noexec
rw size=10% nosuid noexec
rw nodev nosuid noexec
rw user=root nodev nosuid
COPYRIGHT
Copyright (C) 2015 Trevor Bramwell License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
CHANGELOG
0.2.0
field arguments can be now be listed as either a single field, or an increasing or decreasing range.
Manpage included with package.
Added -v, --version option for displaying version and license information.
Changed -h, --help option to display better usage and include license.
0.1.0
Initial Release
fields can be extracted from stdin or explicit files.
Added -f, --file, -d, --delimiter, and -h, --help options.
Metadata
Release files for field 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| field-0.2.0.tar.gz | 18.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| field-0.2.0-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 26.2 kB
Release files / field-0.2.0.tar.gz
| Download URL | field-0.2.0.tar.gz |
|---|---|
| Size | 18.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
29394bc076ac37e1b40aa5d9249d8a60056f244bf6167d29cc66ec9d6b7dd182
|
|
BLAKE2b-256 checksum How to use checksums |
5e5155bd7485e2b45cd1f4cfb95526a478e956979ae71d080feadcde14c020fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / field-0.2.0-py2-none-any.whl
| Download URL | field-0.2.0-py2-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
537b72e4067a4a013da2aaf9331b1a19d13438e44012e307a1b7bc2a6a0fd455
|
|
BLAKE2b-256 checksum How to use checksums |
1f54ba56958f8bb315a39571bd671a20ba42678c64859467aaa465a454606c20
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for field 0.2.0
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.