home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
mar94
/
util
/
dbase
/
a-kwic.lha
/
A-Kwic
/
Examples
/
aminet-short.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-02-08
|
2KB
|
59 lines
/*
* aminet.rexx - Generate an inputfile for loaddb from "Aminet" CD listings
*
* $Id: aminet-short.rexx 1.1 1994/02/08 13:32:12 D_Lowrey Exp $
*
* Syntax: rx aminet-short.rexx AMINET_0693:I_AMINET out-file
*
* This ARexx program generates LoadDB input from the I_AMINET short
* listing file on the Aminet CD-ROM from Walnut Hills.
*
* It should also work on the LONG listing file that you can FTP from Aminet.
*/
directory = ""
parse arg infile outfile
if ~open('Input', strip(infile), "Read") then do
say "Cant open input file==>'" || infile
exit 20
end
if ~open('Output', strip(outfile), "Write") then do
say "Cant open output file==>'" || outfile
exit 20
end
do while ~eof('Input')
line = readln('Input')
if substr(line,1,6) = "======" then
iterate
if line = "" then
iterate
if datatype(substr(line,1,1), 'A') then do
if substr(line,1,10) = 'Directory ' then do
parse var line . directory .
directory = strip(directory)
say "Processing directory: " directory
parse var directory . "/" dir1 "/" dir2 "/" dir3
iterate
end
parse var line title contents
title = strip(title)
contents = strip(contents)
r=writeln('Output', "#R")
r=writeln('Output', "#H " || title )
r=writeln('Output', "#K" title dir1 dir2 dir3)
r=writeln('Output', "#K pgm/" || title)
r=writeln('Output', "#T")
r=writeln('Output', "#T" || directory || "/" || title)
r=writeln('Output', "#T")
r=writeln('Output', contents)
end
end
r=close('Input')
r=close('Output')