Results for “Transforming text”
Small, practical examples. Search by task or narrow things down below.
Extract a delimited text column
Linux Commands: Use cut for simple unquoted delimiter-separated text.
Linux Commands✓ Tested
Collapse repeated spaces
Linux Commands: Use tr -s when repeated occurrences of a character should become one.
Linux Commands✓ Tested
Convert tab stops to spaces
Linux Commands: Use expand with a fixed tab width when preparing plain-text alignment.
Linux Commands✓ Tested
Join lines from two files side by side
Linux Commands: Use paste to pair lines by position with a chosen separator.
Linux Commands✓ Tested
Print a selected range of lines
Linux Commands: Use sed -n with a line address to suppress other output.
Linux Commands✓ Tested
Print the final lines of a file
Linux Commands: Use tail -n for a fixed-size suffix of a log.
Linux Commands✓ Tested
Remove blank or whitespace-only lines
Linux Commands: Use a POSIX character class so tabs and spaces are handled together.
Linux Commands✓ Tested
Remove carriage-return characters
Linux Commands: Use tr -d to remove CR characters from Windows-style line endings.
Linux Commands✓ Tested
Reorder fields with a capture group
Linux Commands: Use extended regular expressions and backreferences to rearrange a known format.
Linux Commands✓ Tested
Translate ASCII lowercase letters to uppercase
Linux Commands: Use tr under a fixed locale for predictable ASCII character ranges.
Linux Commands✓ Tested
Accept several lines of text
HTML: Learn how to accept several lines of text in a complete browser example.
HTML✓ Tested
Add a multiline text field
Set a maximum length and visible rows on a labeled HTML textarea.
HTML✓ Tested