home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
timezn_c.zip
/
TZFIX.CMD
< prev
Wrap
OS/2 REXX Batch file
|
1996-04-27
|
2KB
|
67 lines
/* OS/2 Rexx Script for MR/2 ICE */
/* by William H. Geiger III 07 Apr 96 */
/* Geiger Consulting */
/* whgiii@amaranth.com */
/* this script will convert the Date: stamp */
/* in the header of messages back to original */
msg_filename=''
parse arg msg_filename
xx4=0
xx5='Date:'
xx6='Old TimeStamp:'
xxfix=0
yy1='Date:'
yy2='X-Mailer:'
yy3='From:'
yy4='MR/2'
yyfix='Fixed:'
lin=''
dt_no=0
gb=0
cnt=0
nxy=1
do forever while (length(linein(msg_filename))>0) /* pull info from file header */
nxx=stream(msg_filename,'c','seek +0') /* get read pointer */
nxx_rs=stream(msg_filename,'c','seek =' nxy) /* reset read pointer */
xx7=0
cnt=cnt+1
lin=linein(msg_filename)
nxy=stream(msg_filename,'c','seek +0')
xx7=pos(xx6,lin,1)
xxfix=pos(yyfix,lin,1)
if xxfix>0 then xxfix1=1
If xx7>0 then do
dt=lin
dt_no=cnt
end
end
st1=stream(msg_filename,'c','close')
if dt_no=0 then call goodby
parse value dt with aa bb dowt date mont yr tm tz tzt
dt1=yy1 dowt date mont yr tm tz tzt
'@echo off'
copy msg_filename 'temp.msg' '>>null'
'@echo off'
erase msg_filename '>>null'
st3=stream('temp.msg','c','open') /* re-write msg file with original timestamp */
st4=stream(msg_filename,'c','open')
do forever while lines('temp.msg')>0
lnin = linein('temp.msg')
If pos(xx5,lnin)>0 then do
call lineout msg_filename,dt1
if xxfix1=0 then call lineout msg_filename,'Fixed:'
end
else if pos(xx6,lnin)>0 then iterate
else call lineout msg_filename,lnin
end /* do */
st3=stream('temp.msg','c','close')
st4=stream(msg_filename,'c','close')
erase 'temp.msg >> null'
goodby= 'all done'
gb=1
call goodby
goodby: /* exit routine */
stm_gb=stream(msg_filename,'c','close')
exit