programming

How do I remove a column from a file using awk?

To exclude columns from being printed, you can use one of the following approaches:

awk ‘{$1 =””; print }’ file

which nulls out column 1.

You can also use this:

awk ‘{print $2, $3, $4, $5}’ file

if your file has 5 fields.

1 Comment

1 Comment

  1. online pool games

    October 16, 2010 at 5:23 am

    Good blog! I actually love how it’s easy on my eyes and also the data are well written. I am wondering how I could be notified whenever a new post has been made. I have subscribed to your rss feed which need to do the trick! Have a nice day!

Leave a Reply

Your email address will not be published. Required fields are marked *

To Top