home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
listnews.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1997-09-25
|
894b
|
39 lines
/* List newsgroups from Netscape news.rcg file
Author: Kenneth Porter (shiva@well.com)
Redistributable with attribution.
*/
parse arg filename
if '' == filename then do
say 'usage: ListNews news.rcg'
return 1
end
call stream filename, C, 'query exists'
if result = "" then do
say 'File "' || filename || '" not found'
say 'usage: ListNews news.rcg'
return 1
end
do until lines(filename) == 0
line = linein(filename)
level = substr(line,1,1)
component = substr(line,2)
/* look for lines that start with a digit followed by a letter */
if (datatype(level,'N') & datatype(substr(component,1,1),'M')) then do
j = 1 + level
group.j = component
fullgroup = group.1
do i = 2 to j
fullgroup = fullgroup || '.' || group.i
end
call lineout ,fullgroup
end
end
call stream filename, 'c', 'close'
exit 0