4 ms·
I'm always surprised when people recommend awk for pulling delimited sections of lines out of a file, cut is so much easier to work with.
by mprovost 12y ago
I'm always surprised when people recommend awk for pulling delimited sections of lines out of a file, cut is so much easier to work with.
- ciupicri 12y agoThat's because cut sucks when fields can be separated by multiple space or tab characters. # printf '1 2\t3' | cut -f 2 3 # printf '1 2\t3' | awk '{print $2}' 2 # printf '1 2\t\t3' | cut -f 2 # printf '1 2\t\t3' | awk '{print $2}' 2
- deleted 12y ago[deleted]