|
|
Question : Parse Text File
|
|
I'm working on small app that allows the user to upload a text file to the server. How can I parse between to specified tags and use that info as the description.
For example, user uploads a text file that contains an html table.
<p>Buy 4 Packs, Get 1 Pack FREE!t>> |
I would like to be able to parse between these 2 td tags and insert the text into a db as the description text.
|
Answer : Parse Text File
|
|
using this code:
"">(.*)d>", thisstring, 1, True)>
#mid(thisstring, blah.pos[2], blah.len[2])#
It can be anything in between the td tags, i was only setting a variable so you could see it working, you would use the variable specified when you read in the file |
|
|
|
|