The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Adding Leading Zero with Right Justified and Removing Duplicates
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
Adding Leading Zero with Right Justified and Removing Duplicates
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
4
(
permalink
)
03-18-2009
summer_cherry
Registered User
Join Date: Jun 2007
Location: Beijing China
Posts: 1,092
Hi, hope below can help you.
But really do not know how many leading '0' you are expecting.
Code:
awk -F"," '{ if(_[$1]==0){ _[$1]=1 print $0 } }' a > t1 join -t"," -11 -25 t1 b
summer_cherry
View Public Profile
Find all posts by summer_cherry
Find summer_cherry's past nominations received
Find summer_cherry's present nominations given