SilverWav's Journal

The best is yet to come…

Note: Remove First Column

leave a comment »

Remove first column of a space delimited text file.

cut -d\  -f2- file.txt > file_cut.txt

Cut is better than awk for this job, as you can see from the example below.

awk '{print $2" "$3" "$4" "$5" "$6" "$7" "$8" "$9" "$10" "$11" "$12"}' file.txt

Cut Details:
-d, –delimiter (using SPACE instead of TAB for field delimiter)
-f, –fields (select only these fields (-f2- parses as field2 to end of line).

Advertisements

Written by SilverWav

April 12, 2010 at 8:32 pm

Posted in Notes

Tagged with , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: