Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to remove the multiple records and keep the original order

Status
Not open for further replies.

dfs1988

Programmer
Aug 5, 2007
4
0
0
US
Hi,

I have an file like this


a13
a12
a11
a12
a11
a11
a13


I would like to have an output file like this, remove the multiple records and keep the order

a13
a12
a11

Regards


Mike


 
One way:
Code:
awk '!($1 in a){print;a[$1]}' input > output

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top