Select a particular column using awk or cut or perl

awk, perl, sed, unix

Solution

If the data is unambiguously tab-separated, then `cut` will cut on tabs, not spaces:

cut -f7 filename

You can certainly do that with `awk`, too:

awk -F'\t' '{ print $7 }'

Problem

I have a requirement to select the 7th column from a tab delimited file. eg: ``` cat filename | awk '{print $7}' ``` The issue is that the data in the 4th column has multiple values with blank in between. example - The last line in the below output: ``` user \Adminis FL_vol Design 0 - 1 - group 0 FL_vol Design 19324481 - 3014 - user \MAK FL_vol Design 16875161 - 2618 - tree 826 FL_vol Out Global Doc Mark 16875162 - 9618 - /vol/FL_vol/Out Global Doc Mark ```

Original source