My inout data are:2330019295 and 161006934583
if input data is 10 character then I get this 23300-19295-
if inout data is 12 then look like this 16100-69345-83
which is good How can get rid of the last "-" in 10 character input
fd4 = substr($0,21,12)
# Insert "-" after each group of 5 chars.
gsub( /...../, "&-", fd4 )
# Remove any trailing "-".
sub( /-$/, "", fd4 )
if input data is 10 character then I get this 23300-19295-
if inout data is 12 then look like this 16100-69345-83
which is good How can get rid of the last "-" in 10 character input
fd4 = substr($0,21,12)
# Insert "-" after each group of 5 chars.
gsub( /...../, "&-", fd4 )
# Remove any trailing "-".
sub( /-$/, "", fd4 )