Issue
I have a text file like this:
aaaa bbbb cccc
dddd eeee ffff
gggg hhhh iiii
...
..
.
How can I create a text file only with first column of every lines with awk
or sed
like this?
aaaa
dddd
gggg
...
..
.
I have seen similar topics but I could not resolve my problem!
Solution
If your input is
aaaa bbbb cccc dddd eeee ffff gggg hhhh iiii
and what you want is:
aaaa dddd gggg
then you can use any of:
awk NF=1 input.file sed 's/ .*//' input.file cut -d' ' -f1 input.file
Answered By - Mischa