Create a for loop with a range of the file numbers (101-…)
<@ASSIGN
NAME=”FileName” VALUE=”FilesStart@@local$LoopNbr.txt”
SCOPE=”local”>
Load
the files in a file action into local variable local$CurLoadedFile
Use
the following to extract
<@SUBSTRING
STR=@@LOCAL$CurLoadedFIle START=1 NUMCHARS=<@LOCATE
STR=”@@LOCAL$CurLoadedFIle” FINDSTR=”<center>” >>
This will get you the top section prior to
the <center> to mess with.
I think this is what you’re getting
at ;-)
-----Original Message-----
From: Roland Dumas
[mailto:[EMAIL PROTECTED]
Sent: Thursday, July
24, 2003 11:01 AM
To: WiTango List
Cc: Jason Pamental
Subject: Witango-Talk: how would I
parse this?
How would I go about parsing a file in to clean variables?
about a year ago, I created an unthreaded forum. Not wanting to put it on FMP,
and witango not ready for Mac, I made it file-based. Each submission writes a
file with the guts of the message in it and then a link is created to a .tml
that sucks up the guts as an include into a formatted page.
http://www.patricknagel.com/forum/forum.taf
OK, it's ugly, but it worked.
Someone reminded me that when mysql and witango talked, I'd redo that as a
database app so it can be searched, etc.
Yesterday, I did that, and now have a challenge. Getting all those messages
into the database. I can copy/paste about 1000 files, which will take forever
and be boring as hell. Then, I might come up with a way to read and parse these
messages and auto-submit.
Since the files are serial numbered: 101.txt, 102.txt, etc.
I was thinking of a taf that looped through a number sequence, read each file,
parsed it, turned the pieces into variables, and then submitted to database.
The question is how to parse it.
Here is a typical file:
<H1>I have two Nagels</H1>
<H2>Roni</H2>
<p><A
HREF="" PROTECTED]">[EMAIL PROTECTED]</A></p>
<h2>07/23/03</H2>
<p>I have two Nagel prints with CERT. OF AUTHENTICITY.... but, they don't
say a name on them.. HOW DO I FIND OUT WHAT THEY ARE WORTH? HOW DO I LOOK THEM
UP..? THE CERTIFICATE NUMBERS ARE B4288G & B101250.. I WOULD REALLY
APPRECIATE anyone's assistance with this. [EMAIL PROTECTED]</p>
<center>
<form name="reply" method="post"
action="">
<input type="hidden" name="subject" value="I have
two Nagels">
<input type="hidden" name="author"
value="Roni">
<input type="hidden" name="comment" value="I have
two Nagel prints with CERT. OF AUTHENTICITY.... but, they don't say a name on
them.. HOW DO I FIND OUT WHAT THEY ARE WORTH? HOW DO I LOOK THEM UP..? THE
CERTIFICATE NUMBERS ARE B4288G & B101250.. I WOULD REALLY APPRECIATE
anyone's assistance with this. [EMAIL PROTECTED]">
<input type="submit" name="Submit" value="Respond
to this message">
</form>
</center>
/smaller>/fontfamily>Everything past the first <center> is
unnecessary. Got an idea how best to do that?
Thanks for any hints.
RAD