There are a lot of text parsing functions out there in the public domain: briandunning.com.
Also, you can write your own based on an example there.
Without knowing what's in your field and what you would like to extract, it is hard to help.
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
Hi there Agnes,
Thanks for replying. I have added a file to the thread now called "show.txt"
This is the text which is in the field I was describing (badly )
If you copy and paste the code it in to something like : http://htmledit.squarefree.com/ you will see there is a table in the description which has three bits of information; Box Condition, Item Condition, and Notes. I need to extract this info from 912 records so that I can then merge it in to some new and better looking code we have got.
Hi there Michael,
That is exactly what I was after, thank you!!
However I am struggling to make it work for the other two bits of information I need to extract. Also the one you kindly gave me the calculation for has managed to extract 762 of the 912 records but I am guessing this is because the HTML code must vary in the other records.
Is there any chance you could take a look at the actual database which I have attached. I realise this could be asking too much but if it is the done thing I am willing to pay for your time as I am desperate to get this information out today so we can finish our eBay shop with some much better looking code.
ebay_new_listing.fp7.zip 674.2 K
Is this a one-time conversion or something you expect to be doing on a regular basis?
Hi there Michael,
Its just a one off. The HTML is from the item description in our ebay store but we had a new design made for us so I need to merge the extracted information with the new HTML code which I know how to do.
Well there are 900+ so it would take quite a while
I am not sure how I can help you at this point. You have (at least) two types of HTML code. My file shows how to extract specific data given some markers. It's a matter of identifying the markers and placing them in the formula.
I know what you mean and I appreciate your help, I really do, maybe you can just explain if you have time how the calculation works?
Let ( [
mark = ">Box Condition<" ;
prefix = "<span style='font-family: \"\"\"\"Verdana\"\"\"\" ,\"\"\"\"sans-serif\"\"\"\"; font-size: 10pt;'>" ;
suffix = "</span>" ;
marker = Position ( Description ; mark ; 1 ; 1 ) ;
len = Length ( prefix ) ;
start = Position ( Description ; prefix ; marker ; 1 ) ;
end = Position ( Description ; suffix ; start+ len ; 1 )
Case ( start ; Middle ( Description ; start + len ; end - start - len ) )
I get the prefix and suffix bit but I am guessing the "mark" is saying find this bit of text and then find the NEXT occurance of prefix and suffix and then take the bit of text etc?
I guess then to get the 2nd and 3rd bits of information I would need to find another bit of unique text to then make a second marker after the 1st occurance ie.the Box Condition, Result ?
The parsing might be much simpler if you do the following:
Cratea a table with the url for each page you need to parse in a record field. Add a web viewer that display same. Then loop through copying and pasting the rendered page content from the web viwer into a text field. Then parse that the field rather than the orignal html.
PS when scripting, pause for a second or two on each record so there is time for the web viewer to load,
I am guessing the "mark" is saying find this bit of text and then find the NEXT occurance of prefix and suffix and then take the bit of text etc?
Yes, that is correct. The mark is a distinct identifier of the desired bit - unfortunately, it's too far from the actual data. The prefix, OTOH, could appear anywhere.
PS again: for the web viewer you can usea calculated data/text url based on the actaul raw html rather than an actual call to a website.