Ivor O’Connor

May 13, 2012

Remove Duplicate Lines In File And Keep Order

Filed under: Uncategorized — ioconnor @ 3:12 pm

awk ‘ !x[$0]++’ file3

I found this at http://unstableme.blogspot.com/2008/03/remove-duplicates-without-sorting-file.html and don’t understand how it works. I’ve needed this from time-to-time though and don’t want to search for it again.

 

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

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

Blog at WordPress.com.

%d bloggers like this: