awk Column Extractor
Pick columns out of whitespace-aligned or delimited text, filter lines by a pattern, and get the equivalent awk and cut commands.
Free · No sign-up · Your inputs stay in your browser
Input
Extract columns like awk
Output
Columns
85 characters
awk
awk 'NR > 1 { print $1, $2, $4, $11 }' OFS='\t' file
awk splits on runs of spaces and tabs by default and ignores leading blanks; cut splits on every single delimiter, so cut -d' ' breaks on aligned output like ps or docker ps. Use awk for whitespace-aligned text and cut for CSV-like data without quoting.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
awk or cut
awk splits on runs of spaces and tabs by default and ignores leading blanks, which is what aligned command output needs. cut splits on every single occurrence of its delimiter, so on aligned output it returns empty fields. cut is the right tool for CSV-like data without quoting; awk for everything a person formatted with spaces. The gawk manual is the reference.
Beyond printing columns
awk is a small language: awk '{sum += $5} END {print sum}' totals a column, awk '$3 > 80' filters by value, and awk -F: '{print $1}' /etc/passwd lists users.