# Here's my take:
# don't even want to do anything if there's no dashes.
# assume data 30-JAN-00 like this is a field all by itself
# split the field into 3 if it has dashes
# change month to a number
# if all 3 fields are numeric change the field to new structure
# I leave the possible Y2K problem to you, and I leave it
# to you to add your time string.
#!/bin/ksh
while read line
do
if ( echo $line|grep - > /dev/null )
then
line=$(echo $line|nawk -f awkfile)
fi
echo $line >> new.file
done < data.file
# and here's awkfile:
# awkfile
{
# for each field
for(i=1; i<=NF; i++)
{
# need a dash
if ( match($i, "-"

> 0)
{
# 3 fields
anf=split($i, a, "-"

if (anf == 3)
{
mno=month_num(a[2])
# set your field if it's numeric
if ( is_numeric(a[1]) && is_numeric(mno) && is_numeric(a[3]) )
$i=sprintf("20%s-%02d-%02d\n", a[3], mno, a[1])
}
}
}
print $0
}
function is_numeric(field) {
if ( field ~ /^[0-9]+$/ )
return 1
else
return 0
}
function month_num(month) {
if (month == "JAN"

return 1
if (month == "FEB"

return 2
if (month == "MAR"

return 3
if (month == "APR"

return 4
if (month == "MAY"

return 5
if (month == "JUN"

return 6
if (month == "JUL"

return 7
if (month == "AUG"

return 8
if (month == "SEP"

return 9
if (month == "OCT"

return 10
if (month == "NOV"

return 11
if (month == "DEC"

return 12
return "E"
}