-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Andrew edited this page Dec 31, 2018
·
20 revisions
pipe.pl is the Swiss Army knife of text editing on the command line. Over time I have had to write and re-write scripts that do many of the operations in pipe.pl. This script wraps them with a 'simple' API that allows you to do things that are difficult or tedious in higher languages.
- Trim arbitrary fields.
- Merge content from another file
- Order and suppress output of arbitrary fields.
- Randomize all, or a specific sample size of the records from input.
- De-duplicate records from input.
- Count non-empty fields from input records.
- Summation over non-empty numeric values of arbitrary fields.
- Sort input lines based on one or more arbitrary fields, numerically or lexical-ly.
- Mask output of specific characters, and range of characters, within arbitrary fields.
- Change case, order, and normalize strings in columns.
- Averages over columns.
- Output line numbers or counts of de-duplicated records.
- Force trailing pipe on output.
- Grep a specific column value with regular expressions.
- Compare columns for differences.
- 'if'-like tests of values in columns..
- Flexibly pad output fields.
- Report maximum and minimum width of column data.
- Output sub strings of values in columns by specific index or range of indices.
- Change case of fields.
- Normalize arbitrary fields to remove quotes, spaces, digits non-digits, etc.
- Flip character value conditionally.
- Convert input into different radix.
- Replace values in columns conditionally.
- Translate values within columns.
- Compute new column values based on values in other columns recursively.
- Sum values over groups.
- Merge columns.
- Increment values in columns.
- Add an auto-increment column.
- Output alternate lines.
- Show regional context of a match. See -g and -G.
- Take input from named file (see -0).
- Compute the delta between lines.
- Histogram values within columns.
- Math over columns.