Hi All,
What I am looking for is when "AN=tolower(substr($1,1,15))" is declared (1123456789), I need to sub a zero in front of it which will result in 01123456789
Part of my script
}
for (e=1;e<NF;e++){if ($e~/P=67/)
{printf "%s %s %15s %s %s\n" ,Anum ,DATE, BNUM,DUR,$(e+1)
}
}
}' |
awk '{
hexstr="0123456789abcdef"
#newnum=tolower(substr($4,3,2) substr($4,1,2) substr($4,1,2))
newnum=tolower(substr($4,5,2) substr($4,3,2) substr($4,1,2))
YEAR=tolower(substr($2,1,2))
MONT=tolower(substr($2,3,2))
DAY=tolower(substr($2,5,2))
HOUR=tolower(substr($2,7,2))
MIN=tolower(substr($2,9,2))
SEC=tolower(substr($2,11,2))
#OPE=tolower(substr($5,1,6))
OPE=tolower(substr($5,5,2) substr($5,3,2) substr($5,1,2))
AN=substr($1,1,15)
#AN1=(gsub(AN,"^0AN",AN))
Many Thanks
Chris
What I am looking for is when "AN=tolower(substr($1,1,15))" is declared (1123456789), I need to sub a zero in front of it which will result in 01123456789
Part of my script
}
for (e=1;e<NF;e++){if ($e~/P=67/)
{printf "%s %s %15s %s %s\n" ,Anum ,DATE, BNUM,DUR,$(e+1)
}
}
}' |
awk '{
hexstr="0123456789abcdef"
#newnum=tolower(substr($4,3,2) substr($4,1,2) substr($4,1,2))
newnum=tolower(substr($4,5,2) substr($4,3,2) substr($4,1,2))
YEAR=tolower(substr($2,1,2))
MONT=tolower(substr($2,3,2))
DAY=tolower(substr($2,5,2))
HOUR=tolower(substr($2,7,2))
MIN=tolower(substr($2,9,2))
SEC=tolower(substr($2,11,2))
#OPE=tolower(substr($5,1,6))
OPE=tolower(substr($5,5,2) substr($5,3,2) substr($5,1,2))
AN=substr($1,1,15)
#AN1=(gsub(AN,"^0AN",AN))
Many Thanks
Chris