home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Meeting Pearls 3
/
Meeting_Pearls_III.iso
/
Pearls
/
text
/
FAQ
/
bonus
/
faq_report.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-08-26
|
2KB
|
66 lines
/* ARexx script
for :Pearls/text/FAQ on CD "Meeting Pearls III"
scanning and reporting
$VER: faq_report.rexx 0.2 (26.08.95) ©1995 Khamsonh Marcel Khounlivong
*/
OPTIONS RESULTS
PARSE ARG faq
faq = Strip(faq)
IF (faq == "") THEN do
SAY "faq_report.rexx 0.1 ©1995 Khamsonh Marcel Khounlivong"
SAY "Usage: faq_report[.rexx] FAQ"
EXIT 0
END
arcname = ""
arcnames = "Archive-Name: Archive-name:"
date = ""
dates = "Date:"
log = ""
string = ""
months = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"
days = "Mon Tue Wed Thu Fri Sat Sun"
IF ~open(file,faq,r) THEN log = '' || faq "can't open"
ELSE DO
CALL scan_word
CALL scan_word
CALL Close(file)
/* easy date format TO use an equalation */
IF (Find(days,Strip(Word(date,1),,',')) ~= 0) THEN
date = SubStr(date, WordIndex(date,2))
day = Right(Word(date,1),2,'0')
month = Right(Find(months,Word(date,2)),2,'0')
year = Right(Word(date,3),2)
IF (arcname ~= "" & date ~= "") THEN
SAY Left(arcname,60) year || month || day faq
ELSE SAY '' || faq "missing keywords (date or archive name)"
END
EXIT
scan_word:
DO UNTIL (string ~= "")
string = ReadLn(file)
END
DO WHILE (string ~= "")
string = Translate(string,' ','09'x)
IF (arcname ~= "" & date ~= "") THEN LEAVE
first = Strip(Word(string,1))
SELECT
WHEN (Find(arcnames, first) ~= 0) THEN
arcname = SubStr(string,WordIndex(string,2))
WHEN (Find(dates, first) ~= 0) THEN
date = SubStr(string,WordIndex(string,2))
OTHERWISE ;
END
string = ReadLn(file)
END
RETURN