The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-04-2008
mondrar mondrar is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 3
reformat date, awk and sed

The command below is getting me the output I need.
awk -F"," ' {
if ($6 = 475) print "@@"$3 " " "0000" $10 "0" $1 "00000000" $8}' ${DIR1}${TMPFILE1} | sed -e 's/@@1//g' > ${DIR2}${TPRFILE}

Output:
900018732 00004961160200805160000000073719

Now I need to incorporate this sed command to reformat the date to mmddyy:
sed 's/^\(..\)\(..\)\(..\)\(..\)$/\3\4\2/'

Any ideas...