reformatting linewrapped e-mail messages.

T

terry l. ridder

hello;

i am attempting to create a searchable archive of an e-mail list that
i am a member of. i have been able to either use existing perl modules
or write perl scripts to perform most of the message checking and reformatting.
what is giving me problems are the linewrapped replies.
i am searching for a way in perl to reformat the linewrapped replies.
i am already using text::autoformat module to deal with messages where the entire
message is on one long line. text::autoformat does not deal with the below case.

i want to reformat from this:
was

to this:
 
G

Gunnar Hjalmarsson

terry said:
i am attempting to create a searchable archive of an e-mail list that
i am a member of. i have been able to either use existing perl modules
or write perl scripts to perform most of the message checking and
reformatting.

Have you checked out http://www.mhonarc.org/ ?
what is giving me problems are the linewrapped replies.
i am searching for a way in perl to reformat the linewrapped replies.

You may want to check out if, and then how, that issue is handled by
MHonArc.
 
T

terry l. ridder

hello;

terrylr> terry l. ridder wrote:
terrylr> > i am attempting to create a searchable archive of an e-mail list that
terrylr> > i am a member of. i have been able to either use existing perl modules
terrylr> > or write perl scripts to perform most of the message checking and
terrylr> > reformatting.

On Thu, 23 Dec 2004, Gunnar Hjalmarsson wrote:
gunnar>
gunnar> Have you checked out http://www.mhonarc.org/ ?
gunnar>
gunnar> > what is giving me problems are the linewrapped replies.
gunnar> > i am searching for a way in perl to reformat the linewrapped replies.
gunnar>
gunnar> You may want to check out if, and then how, that issue is handled by
gunnar> MHonArc.
gunnar>
gunnar>

mhonarc does not do any reformatting on linewrapped mangled messages.
been there, done that, does not work.
 
G

Gunnar Hjalmarsson

terry said:
mhonarc does not do any reformatting on linewrapped mangled messages.
been there, done that, does not work.

Okay. Maybe there is a reason, btw. Given something like this:
abcdef

qpwerpqweri åpqwei råpqowei råpoqwie råpoqwieråpoiqweåproiqwåepo

is there really any safe way to tell whether the string 'abcdef' belongs
to the previos line, or if it's the beginning of the comment on that
line? Maybe there is no safe way to compensate for this sort of
shortcomings in various MUA's and/or their users' limited skill?
 
T

Tad McClellan

Gunnar Hjalmarsson said:
is there really any safe way to tell whether the string 'abcdef' belongs
to the previos line, or if it's the beginning of the comment on that
line?


No.


The bad wrapping has made the data into hamburger, the OP wants
to turn it back into steak.

A futile endeavor, I'm afraid it is too late.
 
T

terry l. ridder

Okay. Maybe there is a reason, btw. Given something like this:


is there really any safe way to tell whether the string 'abcdef' belongs
to the previos line, or if it's the beginning of the comment on that
line? Maybe there is no safe way to compensate for this sort of
shortcomings in various MUA's and/or their users' limited skill?
i figure at this point the perl script would have to either be
interactive or table driven.

right now i have a perl script that is close to what i what. i figure i
would map it to a key in the ~/.vimrc file. then using a script file for
vim i could somewhat automate the process. the other option is table
driven give it a hash of hashes that include filename, linenumbers, and
the level of reply nesting.

the ~/.vimrc method is close to working which would beat hand editing,
which is error prone, all the e-mail list archive files. it also makes
the editing consistant across all archive files.

if you are interested i will post the perl script when it is finished.
 
T

terry l. ridder

hello;

No.


The bad wrapping has made the data into hamburger, the OP wants
to turn it back into steak.

A futile endeavor, I'm afraid it is too late.
well actually i have it working. it is interactive but it does work.
the members of the e-mailing list are pleased with the work.

i use the new perl script while editing the archive's mbox files with
vim.

determine the line numbers that need to be demangled than just do:

:53044,.!perl my-format-vim.pl

and that script demangles those lines.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top