|
| 1 | +# Text Processing |
| 2 | + |
| 3 | +| Command | Description | |
| 4 | +|---------|-------------| |
| 5 | +| `grep` | Filter lines by regex | |
| 6 | +| `column` | Extract field by position | |
| 7 | +| `pad-left` / `pad-right` | Pad string to width | |
| 8 | +| `regex-match` | Extract regex matches | |
| 9 | +| `regex-replace` | Replace by regex | |
| 10 | +| `remove-spaces` | Remove all spaces | |
| 11 | +| `remove-newlines` | Remove all newlines | |
| 12 | +| `count-words` | Word count | |
| 13 | +| `count-chars` | Character count | |
| 14 | +| `sort-lines` | Sort alphabetically | |
| 15 | +| `reverse-lines` | Reverse line order | |
| 16 | +| `shuffle-lines` | Shuffle randomly | |
| 17 | +| `unique-lines` | Remove duplicates | |
| 18 | +| `count-lines` | Line count | |
| 19 | +| `number-lines` | Prepend line numbers | |
| 20 | +| `morse-encode` / `morse-decode` | Morse code | |
| 21 | +| `caesar-encode` / `caesar-decode` | Caesar cipher | |
| 22 | +| `markdown-html` | Markdown → HTML | |
| 23 | +| `base-convert` | Arbitrary base conversion | |
| 24 | +| `zeropad` | Zero-pad a number | |
| 25 | + |
| 26 | +## Examples |
| 27 | + |
| 28 | +```shell |
| 29 | +cat file.txt | tweak grep --pattern "^error" |
| 30 | +echo "one two three" | tweak column --field 2 |
| 31 | +echo "5" | tweak pad-left --width 4 --char 0 |
| 32 | +echo "hello" | tweak regex-replace --pattern "l+" --replace "L" |
| 33 | +echo "SOS" | tweak morse-encode |
| 34 | +tweak zeropad --n 6 "42" |
| 35 | +``` |
0 commit comments