Register
It is currently Tue Sep 30, 2014 3:56 pm

awk doesn't print how I want it.


All times are UTC - 6 hours


Post new topic Reply to topic  [ 4 posts ] 
Author Message
 PostPosted: Tue May 11, 2010 1:50 pm   

Joined: Wed Nov 26, 2008 7:43 pm
Posts: 50
Location: Texas
Hi everyone,

I"m trying to print one column of a file
however, it keeps printing it as a row aghh!

Code:
echo `awk < tmp.txt '{ printf "%s\n ", $2 }'`


300 400 500

I want:
300
400
500

How do I fix this?

Ted.


Top
 Profile  
 PostPosted: Tue May 11, 2010 4:52 pm   

Joined: Wed Nov 26, 2008 7:43 pm
Posts: 50
Location: Texas
actually I figured this one, nvm


Top
 Profile  
 PostPosted: Wed May 12, 2010 3:56 am   
Moderator
User avatar

Joined: Thu Oct 11, 2007 7:12 am
Posts: 229
Location: London - UK
Feel free that when you solve your own problem to put the solution on the site so that others searching for the same problem find answers :)


Top
 Profile  
 PostPosted: Wed May 12, 2010 7:49 am   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 549
DarthWavy ++


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP