03-01-2005
119,
1
Join Date: Feb 2005
Last Activity: 8 November 2005, 6:07 AM EST
Location: Coimbatore, Tamilnadu, India
Posts: 119
Thanks Given: 0
Thanked 1 Time in 1 Post
ok. Try this as,
awk -F , '{ la=substr($1,1,2);lb=substr($1,3); fa=substr($2,1,2);fb=substr($2,3); ma=substr($3,1,2);mb=substr($3,3); print fa""tolower(fb)", "ma""tolower(mb)", "la""tolower(lb) }' <filename>
For Example as,
# echo " LASTNAME, FIRSTNAME, MIDDLEINITIAL" | awk -F , '{ la=substr($1,1,2);lb=substr($1,3); fa=substr($2,1,2);fb=substr($2,3); ma=substr($3,1,2);mb=substr($3,3); print fa""tolower(fb)", "ma""tolower(mb)", "la""tolower(lb) }'
Firstname, Middleinitial, Lastname
HTH.