(module for) RTF parsing ?

T

TDJ

I can find modules for making RTF files, but what if I want to go
the other way ?

I have a number of files (SMS messages) in a directory, which I
would like to convert to a database / table.

The message format per file is similar to:
(line feeds added for illustration.)

Anyone have hints at parsing that file ?

------------ start -------------------------------------
{
tf1\ansi\ansicpg1252\deff0\deflang1030
{\info
{\*\SemKeywords SEM
(SMS,NO_DM,NO_SMS_PIC,NO_SMS_SOUND,STATUS_REPORT,NO_REPLY_PATH,3-9-28-16-
28-33-8,+4599999999,VPREL:0-0-10-0,ST:1,PBLIST:+4588888888)
}
}
{\fonttbl
{\f0\fswiss\fprq2\fcharset0 Arial;}
}
\viewkind4\uc1\pard\f0\fs22
Message message bla bal abl ablba l balabablablasbdflkjsd flijg sidjfidifj
jijdifjdifj difj difj idjf idjf idjf idjf idj f
\par
}
----------- end --------------------------------------
 
J

James Willmore

I can find modules for making RTF files, but what if I want to go
the other way ?

http://search.cpan.org/~sargie/RTF-Tokenizer-1.05/lib/RTF/Tokenizer.pm

This *should* read an RTF file and "translate" it for you.

HTH

--
Jim

Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.

a fortune quote ...
In a museum in Havana, there are two skulls of Christopher
Columbus, "one when he was a boy and one when he was a man."
<-- Mark Twain
 

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

Similar Threads

uncleared code 2
howto write rtf directly? 3

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top