Re: Date field sorting

From: Allen Scott-Thoennes (sthoenna@efn.org)
Date: Sun, 21 Sep 1997 01:01:50 -0700

In article <WFsI0M1eHxMf092yn@best.com>, rdell@best.com (Richard Dell) wrote:
>I have just recently started using Yarn, and would like
>to know if there is any method of sorting the news articles
>in Date: header order, rather than arrival order?? I have
>read references to y_order, and am trying to find it, and have
>looked at the Yutil folder sorting routine, which so far I
>have not gotten to work, which also works on Folders rather
>than the news articles directly. Am I to assume that the
>only way would be to save all the articles to a folder, expire
>all the articles in the news group, sort the folder and use the
>Yutil package to resend it? Is there any simple way to mass
>save all articles in a news group to a folder?

It seems to me what you want is a method to save all articles in a
soup file to a folder. I thought there was a utility to do this, but
I wasn't able to find it. However, you can do it through the following
somewhat cumbersome method.

Yarn .89 (and earlier) stores news in multiple folders in the %yarn%\news
directory, based, I think, on expiration date. Thus you could set up a
dummy installation of this version in a completely separate directory,
making sure the config file has keep and maxkeep set to 1, and import
your news into it. Then copy the news folder(s) it generates, run the
folder sorter on it, and convert it back into a soup file. (You should
also, of course, expire the articles from the yarn .89 installation.)

An import batch file using this method would look something like:

rem use alternate yarn newsbase
set YARN=c:\yarn89
rem config89 should be a copy of %home%\yarn\config with keep & maxkeep = 1
set YARNRC=c:\yarn89\config89
c:\yarn89\import <soup-file-name>
rem use normal yarn newsbase and config file
set YARN=c:\yarn
set YARNRC=
for %%n in (c:\yarn89\news\*.*) do call impsortd %%n
rem clear alternate yarn newsbase
SET YARN=c:\yarn89
c:\yarn89\expire -o -d 999
SET YARN=c:\yarn

with the impsortd batch file as follows:

c:\yarnutil\sortfold %1 tempfold <sortfold options> (or use f_order)
c:\yarnutil\sendfold tempfold /Anul (or use ytsg)
del tempfold
c:\yarn\import -u

Note that the for loop should only find one news folder name (if I
understand correctly how it used to work. The only exception I can
think of might be that articles with an Expires header in the past
could come out in a separate file.)

The /Anul parameter on sendfold keeps it from sorting by newsgroup
which could mess up the sorting by date for crossposted articles.

It might be faster to just delete each news spool file (del %1 in impsortd)
after processing it and do a rebuild -o -h instead of an expire.

Good luck!