🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nn
4 messages
4 total messages Started by Paul C. Sorenson Sun, 30 Nov 1997 00:00
How to split saved articles?
#8838
Author: Paul C. Sorenson
Date: Sun, 30 Nov 1997 00:00
18 lines
1284 bytes
Is there a sentinal character or string that delimits articles saved
from nn?

I'm trying to sift through a few megabytes of articles I have saved
from nn (mostly) over the years.  For any one newsgroup, my saves from
nn have created what appear to be large ASCII files of concatenated
articles.  I would like to delimit the articles with something like
"\n--" (where "\n" is newline) for use in my favorite Personal
Information Manager (PIM), InfoSelect from Micro Logic Corp.  I can
edit the ASCII files to insert the "\n--"'s, but doing that by hand
would be tedious.  How can I algorithmacly find where to put the
"\n--"'s?
-- 
Paul C. Sorenson
paulcs@netcom.com

Re: How to split saved articles?
#8839
Author: Sven Guckes
Date: Mon, 01 Dec 1997 00:00
39 lines
2110 bytes
paulcs@netcom.com (Paul C. Sorenson):
> Is there a sentinal character or string
> that delimits articles saved from nn?

Saving articles *with* header should suffice for
mailers and newsreaders to split up a folder.

> I'm trying to sift through a few megabytes of articles I have saved from nn
> (mostly) over the years.  For any one newsgroup, my saves from nn have
> created what appear to be large ASCII files of concatenated articles.

These are called "folders", btw.

> I would like to delimit the articles with something like "\n--" [...]
> for use in my favorite Personal Information Manager (PIM):
> InfoSelect from Micro Logic Corp.
> I can edit the ASCII files to insert the "\n--"'s, but doing that by hand
> would be tedious.  How can I algorithmacly find where to put the "\n--"'s?

Assuming you have been saving the articles with nn and with headers
then these shuld be in "mailbox format", ie each headers starts with
a "From_" line (where the _ stands for a space).

Adding the "--" line should be as easy as this with vi (and clones):

	:%s/^From /--^M&/

Or use Perl.  Or .. whatever.

Sven

-- 
Sven Guckes guckes@math.fu-berlin.de using NN 6.5.0 #0 (NOV) [961201]
NN Pages:          http://www.math.fu-berlin.de/~guckes/nn/
NN wishlist:       http://www.math.fu-berlin.de/~guckes/nn/wishlist.html
NN sample setup:   http://www.math.fu-berlin.de/~guckes/setup/#nn  [970630]

Re: How to split saved articles?
#8840
Author: Paul C. Sorenson
Date: Mon, 01 Dec 1997 00:00
79 lines
3742 bytes
guckes@math.fu-berlin.de (Sven Guckes) writes:

>paulcs@netcom.com (Paul C. Sorenson):
>> Is there a sentinal character or string
>> that delimits articles saved from nn?

>Saving articles *with* header should suffice for
>mailers and newsreaders to split up a folder.

>> I'm trying to sift through a few megabytes of articles I have saved from nn
>> (mostly) over the years.  For any one newsgroup, my saves from nn have
>> created what appear to be large ASCII files of concatenated articles.

>These are called "folders", btw.

>> I would like to delimit the articles with something like "\n--" [...]
>> for use in my favorite Personal Information Manager (PIM):
>> InfoSelect from Micro Logic Corp.
>> I can edit the ASCII files to insert the "\n--"'s, but doing that by hand
>> would be tedious.  How can I algorithmacly find where to put the "\n--"'s?

>Assuming you have been saving the articles with nn and with headers
>then these shuld be in "mailbox format", ie each headers starts with
>a "From_" line (where the _ stands for a space).

Thanks.  (Did you mean "From:_", rather than "From_"?)  What had thrown
me off a bit is that headers seem to vary.  For example, your post
saves with the header...

   Path: ix.netcom.com!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!fu-berlin.de!
   banach.math.fu-berlin.DE!not-for-mail
   From: guckes@math.fu-berlin.de (Sven Guckes)
   Newsgroups: news.software.nn
   Subject: Re: How to split saved articles?
   Date: 1 Dec 1997 13:16:27 GMT
   Organization: Freie Universitaet Berlin
   Lines: 36
   Message-ID: <slrn685e5a.knb.guckes@banach.math.fu-berlin.de>
   References: <paulcsEKHDnG.J1L@netcom.com>
   Reply-To: guckes@math.fu-berlin.de
   NNTP-Posting-Host: banach.math.fu-berlin.de (160.45.40.62)
   Mime-Version: 1.0
   Content-Type: text/plain; charset=iso-8859-1
   Content-Transfer-Encoding: 8bit
   X-Access: 16 17 19
   X-Newsreader-Info: http://www.math.fu-berlin.de/~guckes/slrn/
   X-Newsreader: slrn (0.9.4.3 UNIX)
   Xref: ix.netcom.com news.software.nn:10381

... while other headers saved with different fields...

   Xref: netcom.com comp.lang.idl-pvwave:3385
   Path: netcom.com!ix.netcom.com!howland.reston.ans.net!gatech!rutgers!uwvax!news
   From: Liam Gumley <liamg@ssec.wisc.edu>
   Newsgroups: comp.lang.idl-pvwave
   Subject: Floating Point Bug on Intel Pentium CPUs
   Date: 23 Nov 1994 17:08:44 GMT
   Organization: University of WI, Madison -- Computer Sciences Dept.
   Lines: 19
   Message-ID: <3avsus$22n@spool.cs.wisc.edu>
   NNTP-Posting-Host: noname167.ssec.wisc.edu

...and even some of those fields that were in common, like "Xref:_",
appear in a different order.  (Perhaps this second example header did
not come from nn.)

In any case, if it's safe to assume that there will always be a
"\nFrom:_" field *somewhere* in the header.  I could do a vi macro (or
whatever) that would insert a dilimiter string (such as "--\n", or
whatever) at the top of each paragraph that contains "\nFrom:_".

Thanks, Sven!

-- 
Paul C. Sorenson
paulcs@netcom.com

Re: How to split saved articles?
#8841
Author: Sven Guckes
Date: Tue, 02 Dec 1997 00:00
53 lines
2988 bytes
paulcs@netcom.com (Paul C. Sorenson):
> >Assuming you have been saving the articles with nn and with headers
> >then these shuld be in "mailbox format", ie each headers starts with
> >a "From_" line (where the _ stands for a space).
> Did you mean "From:_", rather than "From_"?

No - I meant "From_" (without a colon).
At least I remember NN prepending such a line when saving in mailbox format.

The manual of NN says under "SAVING ARTICLES":

     Articles can optionally be saved in MAIL or MMDF  compatible
     format by setting the mail-format and mmdf-format variables.
     These variables only specify the format used when creating a
     new  folder,  while  appending to an existing folder will be
     done in the format of the folder (unless folder-format-check
     is false).

So, use "mail-format" or "mmdf-format" in your "init" file!

> In any case, if it's safe to assume that there will always be a "\nFrom:_"
> field *somewhere* in the header.  I could do a vi macro (or whatever) that
> would insert a dilimiter string (such as "--\n", or whatever) at the top of
> each paragraph that contains "\nFrom:_".

Well, assuming mial-format style, you could use this macro with Vim:

	ab  FROM   From comp.mail.elm Tue Dec  2 11:39:17 1997
	map ##    /^From: <C-M>{oFROM<ESC>}

Explanation:
The abbreviation just defines a pseudo-From_ header line for insertion.
The mappings jumps to the next From: line (most probably a header),
goes back before the current paragraph, Opens a line and inserts the
pseudo From_ line; and them jumps behind the paragraph (header).

Remember:  With Vim you can write macros with the "angle notation",
so you can copy&paste them from screen into the vimrc.  :-)

Then again, once a folder has the From_ line at the start,
it should also rewrite folders in the given format.
Try this and give use some feedback, ok?  :-)

Sven

-- 
Sven Guckes   guckes@vim.org  | VIM Latest versions| AmigaOS, Atari MiNT, BeOS,
VIM Home: http://www.vim.org/ | VIM-4.6  [970212]  | DOS, MacOS, OS/2, UNIX,
New features: syntax coloring,| VIM-5.0r [971124]  | VMS, Win95+WinNT.
ex mode, conditional statements, Perl interface, WindowsGUI; more ports!

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