I have files called printfile.log.1121, printfile.log.1122, etc where 1121 and 1122 are the date of the file creation.
The file contents are like:
PHP Code:
================================================================================
User = d_prod
Env = d_prod
Dir = /cerner/d_prod/ccluserdir
Date = Mon Nov 21 00:22:23 EST 2011
From = d_prod 4415706 1 65 23:52:03 - 0:47 cer_exe/cpm_srvscript PROD * * -off
er -factor 1
Cmd = [/cerner/w_standard/prod2003_02/forms/print_file -b -c1 -Piphb3h27p1 -fpost /cerner/d_
prod/ccluserdir/ccltemp4415706d002a.dat]
File = /cerner/d_prod/print/ccltemp4415706d002a.dat.tmp.1121002223
Queue = iphb3h27p1
Copies = 1
Forms = post
Library = /cerner/w_standard/prod2003_02/forms/formhp5.cfg
Init = [1] /cerner/w_standard/prod2003_02/forms/formhp5/post
Reset = [0]
Spawn: [pr -f -t -l66 -w132 /cerner/d_prod/print/ccltemp4415706d002a.dat.tmp.1121002223 |
cat /cerner/w_standard/prod2003_02/forms/formhp5/post - |
qprt -ds -N 1 -P iphb3h27p1 -T /cerner/d_prod/print/ccltemp4415706d002a.dat.tmp
.1121002223]
================================================================================
User = d_prod
Env = d_prod
Dir = /cerner/d_prod/ccluserdir
Date = Mon Nov 21 00:22:38 EST 2011
From = d_prod 7000198 1 51 23:51:39 - 0:44 cer_exe/cpm_srvscript PROD * * -off
er -factor 1
Cmd = [/cerner/w_standard/prod2003_02/forms/print_file -b -c1 -Piphb3h27p1 -fpost /cerner/d_
prod/ccluserdir/ccltemp7000198d004a.dat]
File = /cerner/d_prod/print/ccltemp7000198d004a.dat.tmp.1121002238
Queue = iphb3h27p1
Copies = 1
Forms = post
Library = /cerner/w_standard/prod2003_02/forms/formhp5.cfg
Init = [1] /cerner/w_standard/prod2003_02/forms/formhp5/post
Reset = [0]
Spawn: [pr -f -t -l66 -w132 /cerner/d_prod/print/ccltemp7000198d004a.dat.tmp.1121002238 |
cat /cerner/w_standard/prod2003_02/forms/formhp5/post - |
qprt -ds -N 1 -P iphb3h27p1 -T /cerner/d_prod/print/ccltemp7000198d004a.dat.tmp
.1121002238]
================================================================================
User = d_prod
Env = d_prod
Dir = /cerner/d_prod/ccluserdir
Date = Mon Nov 21 00:22:39 EST 2011
From = d_prod 5193848 1 88 23:46:50 - 1:00 cer_exe/cpm_srvscript PROD * * -off
er -factor 1
Cmd = [/cerner/w_standard/prod2003_02/forms/print_file -b -c1 -Piphb3h27p1 -fpost /cerner/d_
prod/ccluserdir/ccltemp5193848d004a.dat]
File = /cerner/d_prod/print/ccltemp5193848d004a.dat.tmp.1121002239
Queue = iphb3h27p1
Copies = 1
Forms = post
Library = /cerner/w_standard/prod2003_02/forms/formhp5.cfg
Init = [1] /cerner/w_standard/prod2003_02/forms/formhp5/post
Reset = [0]
Spawn: [pr -f -t -l66 -w132 /cerner/d_prod/print/ccltemp5193848d004a.dat.tmp.1121002239 |
cat /cerner/w_standard/prod2003_02/forms/formhp5/post - |
qprt -ds -N 1 -P iphb3h27p1 -T /cerner/d_prod/print/ccltemp5193848d004a.dat.tmp
.1121002239]
================================================================================
User = d_prod
Env = d_prod
Dir = /cerner/d_prod/ccluserdir
Date = Mon Nov 21 00:23:40 EST 2011
From = d_prod 2986152 1 4 13:30:43 - 0:06 cer_exe/srv_drvr PROD * * /cerner/w
_standard/prod2003_02/aixrs6000/scs_srvcoltn
Cmd = [/cerner/w_standard/prod2003_02/forms/print_file -b -c1 -Plb66w7a -fzbdyn16rv /cerner/
d_prod/ccluserdir/ccltemp2986152d010a.dat]
File = /cerner/d_prod/print/ccltemp2986152d010a.dat.tmp.1121002339
Queue = lb66w7a
Copies = 1
Forms = zbdyn16rv
Library = /cerner/w_standard/prod2003_02/forms/formzebra.cfg
Init = [3] /cerner/w_standard/prod2003_02/forms/formzebra/zbdyn16.txt
/cerner/w_standard/prod2003_02/forms/formzebra/zbrot.txt
/cerner/w_standard/prod2003_02/forms/formzebra/zbvirt.txt
Reset = [0]
Spawn: [pr -t -w132 /cerner/d_prod/print/ccltemp2986152d010a.dat.tmp.1121002339 |
cat /cerner/w_standard/prod2003_02/forms/formzebra/zbdyn16.txt /cerner/w_standar
d/prod2003_02/forms/formzebra/zbrot.txt /cerner/w_standard/prod2003_02/forms/formzebra/zbvirt.tx
t - |
qprt -o -dp -N 1 -P lb66w7a -T /cerner/d_prod/print/ccltemp2986152d010a.dat.tmp
.1121002339]
================================================================================
I need to pull out three items from the file. It will be running on cron, so I need to pull the items from the previous day's file (i.e. printfile.log.1121 on 11/22).
Off of the file, I need to have these.
i.e.
PHP Code:
Date = Mon Nov 21 00:33:10 EST 2011
Queue = iphb3h27p1
Forms = post
For the output format, I like to have them in a row with a delimiter pipe (|) so that I can run things in Excel.
PHP Code:
lb66w7a | post | 00:23:40
iphb3h27p1 | post | 00:33:10
etc
etc
Please advise.