kamsabeti
IS-IT--Management
- Feb 26, 2008
- 21
I have 10 and 12 digist number that I like to add "-" between them orginal number are:
1234567890 need to display as 12345-67890
123456789012 need to display as 12345-67890-12
I did on ASP but I need do it on AWK.
Here what I did on ASP:
fh4=trim(mid(str,21,15)) 'Part_No
pn=mid(fh4,1,5)&"-"&mid(fh4,6,5)&"-"&mid(fh4,11,5)
if right(pn,1)="-" then
pn=left(pn,11)
Thanks
Kamran
1234567890 need to display as 12345-67890
123456789012 need to display as 12345-67890-12
I did on ASP but I need do it on AWK.
Here what I did on ASP:
fh4=trim(mid(str,21,15)) 'Part_No
pn=mid(fh4,1,5)&"-"&mid(fh4,6,5)&"-"&mid(fh4,11,5)
if right(pn,1)="-" then
pn=left(pn,11)
Thanks
Kamran