🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
2 messages
2 total messages Started by John Wright/Dr. Pat Lane Mon, 09 Aug 1993 10:45
Saving multipart postings in order using rn (readnews)
#5223
Author: John Wright/Dr. Pat Lane
Date: Mon, 09 Aug 1993 10:45
46 lines
3233 bytes
Something I've been wondering for a while...sorry if it's an FAQ.
(I expect that it is).

Readnews (rn) lists articles by article number using the "=" command.  
You can list a subset of articles based on a string pattern in the 
Subject heading with /pattern/=.  You can save the articles to a file
with /pattern/s file.  You can modify the scope of the search to include
say, the entire header, using /pattern/h:=.

One often sees postings, typically binaries, split up over several 
articles, with subject lines like "Neat Stuff (part 01/42)".  You
save all parts to a file with "/Neat Stuff/s neat_stuff".  The
trouble is the articles are saved in article number order and this
often makes the posting parts out of order (becuase the article
numbers are assigned on an as arrived basis and there's no way to
guarentee that all parts of a multipart post arrive in order - you're
lucky if all parts arrive at all!).  In this case, as far as I know,
you have to save the parts by article number - very tedious.

Is there a better way, using rn?  Whenever I see this question asked
in other groups, the answer is usually "use NN" - another news reader
that, I think, by default, lists articles by subject alphabetically.
If the articles are listed/saved alphabetically, then the parts of
a multipart posting will usually be in order.  Tried nn.  Didn't like it.

I always thought a tantalizingly simple solution would be if 'rn'
expanded the idea of modifiers for the pattern searches to include
sorting specifiers.  Such as /Neat Stuff/sa:s neat_stuff where the
"sa" would mean "sort ascending".  Has any thought been given to 
adding such a feature to 'rn'?

The only other way, I suppose would be a stand alone program that sorted
files of saved articles by subject header or whatever.  Is there such
a tool available?

Looking at the articles here, I see there is something called 'trn'.
It is not yet availaible at this site.  Is it a new version of 'rn'?
Does it have features to make saving multipart postings easier?

Replies by mail would be appreciated as news expires very quickly here.
Thanks for your time.

-- 
John Wright      /////////////////////////////////////////////////////////////
Post: c/o Dr Pat Lane, Biology Dept, Dalhousie U, Halifax N.S., CANADA B3H-4H8 
Internet: lane@cs.dal.ca   Uucp: lane@dalcs.uucp or {uunet watmath}!dalcs!lane
Re: Saving multipart postings in order using rn (readnews)
#5302
Author: Jeremy Mathers
Date: Mon, 16 Aug 1993 15:55
87 lines
3968 bytes
In article <CBHn81.IrL@cs.dal.ca> lane@cs.dal.ca (John Wright/Dr. Pat Lane) writes:
>Something I've been wondering for a while...sorry if it's an FAQ.
>(I expect that it is).
>
>Readnews (rn) lists articles by article number using the "=" command.  
>You can list a subset of articles based on a string pattern in the 
>Subject heading with /pattern/=.  You can save the articles to a file
>with /pattern/s file.  You can modify the scope of the search to include
>say, the entire header, using /pattern/h:=.

This issue is discussed over and over in the various binaries groups
(particularly, in the alt groups) and the "official" solution is to get
one of the many "smart uudecoders" - that is programs that can be fed
the pieces in any order and they sort it out and do the right thing.

However, I find this approach too high tech (*), and so I wrote the
following little script that simply sorts a mailbox formatted file into
a user specified order.

To use it, you enter the piece numbers in the order in which they appear
in the mail file, one per line, followed by a ^D.  The program also
handles the case where you have multiple things to be uudecoded, and the
pieces of the various files are intermixed with each other.  Anyway, it
is kind of a low-tech solution, but it has worked OK for me.

(The script uses two non-standard utilities - pause (which I wrote) and
uuconvert (which is available on the net))
------ Cut here -------
: Sort mail for uuencoding.
case $# in
1)	if [ ! -f $1 ]
	then	echo "Mailbox file: $1 - not found"
		exit 1
	fi
	;;
*)	echo "Arg count error"
	exit 1
	;;
esac
tmp=/tmp/tmp$$
trap "rm $tmp" 0 1 2 3 15
set -e
echo "Enter the order as stored in the mail file..."
nawk '
NF > 0	{ gsub(/[^0-9]+/," ") ; x[sprintf("%05d%05d",$1,$2)] = ++nr }
END	{
	n = ArraySort(x,x1)
	for (i=1; i<=n; i++)
		print "s",x[x1[i]],tmp
	print "x"
	}
#
function ArraySort(In,Out,	i,j) {
	for (i in In)
		Out[++j] = i
	qsort(Out,1,j)
	return (Out[0] = j)
	}
# qsort - sort A[left..right] by quicksort
function qsort(A,left,right,	i,last) {
     if (left >= right)  # do nothing if array contains
         return          # less than two elements
     swap(A, left, left + int((right-left+1)*rand()))
     last = left   # A[left] is now partition element
     for (i = left+1; i <= right; i++)
         if (A[i] < A[left])
             swap(A, ++last, i)
     swap(A, left, last)
     qsort(A, left, last-1)
     qsort(A, last+1, right)
}
function swap(A,i,j,   t) { t = A[i]; A[i] = A[j]; A[j] = t }
#
function Delete(arr) { split("",arr) }
' tmp=$tmp | mail -N -f $1
pause "Press <Esc> to exit; any other to uuconvert & test-pix it..." || exit
uuconvert $tmp
test-pix `nawk '/^begin/ { print $NF }' $tmp`
rm -i $1

************************************************************************
The Zapruder film was a snuff film.

	- pynq@quads.uchicago.edu, who is still costing the net
	  hundreds, if not thousands, of dollars, every time he posts -
************************************************************************
rwvpf wpnrrj ibf ijrfer
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads