Align
Syntax
Section titled “Syntax”splitby --align [selection...]What it does
Section titled “What it does”Aligns the start of each field across records by padding shorter fields with spaces.
Align optionally accepts several different modes:
left: The default, delimiters are aligned and fields at the left of their column.right: Delimiters are aligned and fields at the right of their column.squash: Padding is placed after the delimiter, so the first letter of each field is aligned.none: Disables alignment (useful for overriding a default set in a config or alias).
Examples
Section titled “Examples”Left (the default mode)
Section titled “Left (the default mode)”echo "apple|banana|cherry\na|b|c" | splitby "|" 1 2 --align# apple|banana# a |becho "apple|banana|cherry\na|b|c" | splitby "|" 1 2 --align=right# apple|banana# a| bSquash
Section titled “Squash”echo "apple,banana,cherry\na,b,c" | splitby "," 1 2 --align=squash# apple,banana# a, bGotchas
Section titled “Gotchas”- Only works in per-line mode with field mode.
- Because it must do a first-pass to work out column widths before processing, this flag can limit efficiency in large datasets.