Extact fields from a file
Project description
Name
field - extract fields from a file
SYNOPSIS
field [-h] [-f FILE] [-d DELIMITER] [field [field ...]]
DESCRIPTION
Field extracts a list of fields or columns from a file. It is a simpler version of awk '{ print $1; }'.
Default is to read whitespace (<space><tab>) delimited text from _stdin_ and write fields to _stdout_.
OPTIONS
-f FILE, --file FILE - Extract fields from each line of the _FILE_. Defaults to _stdin_.
-d DELIMITER, --delimiter DELIMITER - Single character used to distinguish between fields. Defaults to whitespace (<space><tab>).
EXAMPLE
$ 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 © 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file field-0.1.0.tar.gz
.
File metadata
- Download URL: field-0.1.0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b2239d1563a7feb10d732d9f0978d9eac751e1d271c58bcf82d59598ea000a5 |
|
MD5 | 738d1af33dfca88beed51d9b4903033c |
|
BLAKE2b-256 | f9e076f2fd972056c01d5d0a0fc3abd49fede95c1a704b6191021001b97af843 |
File details
Details for the file field-0.1.0.linux-x86_64.tar.gz
.
File metadata
- Download URL: field-0.1.0.linux-x86_64.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f96f7a3a6e0c07fba0367121a5a5b8052e2200ede61101dda07a91a33e005694 |
|
MD5 | 531bfdf2c45e846c6138d3a7f22ab298 |
|
BLAKE2b-256 | 560176976f7c00d6cb512903789aa49821af9fc0392c3df704595efec0e3e7f3 |
File details
Details for the file field-0.1.0-py2-none-any.whl
.
File metadata
- Download URL: field-0.1.0-py2-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74d71fc4ef588cb8561fe633dc604cd510ad450bf259dffad209d9692b9fff3b |
|
MD5 | ec2fc9f7f25975c4c5f90705c9bf5a0b |
|
BLAKE2b-256 | 04aafd46c524f7bd7766097f5eecfef2d94d3dcbcdd3bb08c64d4ecfa881d854 |