-1

I have this file and need to cut field 3 which should be cut - f 3. Right? I am using this code and its absolutely not doing anything for me.

grep '^2014-' FileName | cut - f 3| less

enter image description here

3

2 Answers 2

2

can do what grep and cut do, and awk is more flexible by default than cut about its field separators

awk '/^2014-/ {print $3}' filename
1

I believe your problem is that you have a whitespace after - and before f:

grep '^2014-' FileName | cut - f 3| less
                              ^ here

It should be:

grep '^2014-' FileName | cut -f 3 | less

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .