f



awk

grep Glen ~/Check| awk -F " " "{ print $1 }"

I have a file filled with name separated by spaces how can i edit the line
above to split by space


0
James
9/23/2005 10:45:21 AM
comp.unix.programmer 10848 articles. 0 followers. kokososo56 (349) is leader. Post Follow

1 Replies
690 Views

Similar Articles

[PageSpeed] 3

James wrote:
> grep Glen ~/Check| awk -F " " "{ print $1 }"
>
> I have a file filled with name separated by spaces how can i edit the line
> above to split by space

Not sure I read your question correctly, but how about something like:

jc@soyuz:/tmp$ awk 'BEGIN { FS=" " } { print $2 "," $1 }' << EOT
> John Glenn
> Buzz Aldrin
> EOT
Glenn,John
Aldrin,Buzz
jc@soyuz/tmp$

?

0
shakahshakah
9/23/2005 12:00:53 PM
Reply: