Link to home
Start Free TrialLog in
Avatar of jvras
jvras

asked on

How to do this


I have a file like this

001 name_01
002 name_02
003 name_03

The output that I need from this file above is :

001  002  003

How do this in a shell command ? I prefer it to do it with sed or awk.
Thanks for help
jvras
Avatar of yuzh
yuzh

Here is what you need to do:

assume that your file name is: test.txt

type in:

cat test.txt | awk '{print $1} | tr "\012" " " > test.tmp
echo "" >> test.tmp
mv test.tmp test.txt

This should work for you.

ASKER CERTIFIED SOLUTION
Avatar of ecw
ecw

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jvras

ASKER


ecw is giving me the just answer.
Thanks
jvras