Extract text column in bash using awk pipe

By neokrates, written on September 3, 2010

awk   snippet

Rate it
  • 1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
Ad
Poll
  • Best shells (or command line language) are?

    • Bash (47%, 9 Votes)
    • Different shell (21%, 4 Votes)
    • Zsh (21%, 4 Votes)
    • Csh (11%, 2 Votes)
    • Power shell (5%, 1 Votes)
    • Ksh (5%, 1 Votes)
    • Lush (0%, 0 Votes)
    • Quicksilver (0%, 0 Votes)
    • IPython (0%, 0 Votes)
    • Rush (0%, 0 Votes)
    • Pash (0%, 0 Votes)
    • Dos cl (0%, 0 Votes)
    • Fish shell (0%, 0 Votes)

    Total Voters: 19

    Vote

    Loading ... Loading ...
Feeds:
  • bodytext bodytext bodytext
Most popular search terms:

Use form awk "{ print \$COL_1 \$COL_N }" :

user@host:~$ echo "1col 2col 3col 4col 5col" | awk "{ print \$3 \$5 }"
 
3col5col
 
Does that help to solve your problem?
VN:F [1.8.5_1061]
Rating: 0 (from 0 votes)
0 votes 'YES'  0 votes 'NO'
TAGS
RELATED
Pages
Posts
    nope :(
SOCIAL
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • BlinkList
  • Blogosphere News
  • E-mail this story to a friend!
  • Furl
  • LinkArena
  • Live
  • MisterWong
  • Print this article!
  • StumbleUpon
  • Technorati
  • Webnews.de
  • YahooMyWeb

Leave a Reply