Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

how-to get html tags

I'm converting a *&^**( load articles to Access tables.

I want to set up a table using CityScript that I can import into Access.

What I need is all the html in the {$body$} of all the articles to show up in my table.

Any ideas?

Thanks :-)

Bob Bloom
Thursday, March 11, 2004

I don't understand what you are trying to do.  Can you tell us a little more?

joel goldstick
Friday, March 12, 2004

I have a bunch of recipe articles.  Each article has html similar to this:

Moussaka<p>
<p>&nbsp;</p>
<ul>
<li>1 large eggplant, sliced in rounds
</li>
<li>2 large potatoes, sliced thinly
</li>
<li>1 large onion, chopped
</li>
<li>1 clove garlic, minced
</li>
<li>1 lb. lean ground beef
</li>
<li>1 small can tomato paste
</li>
<li>1 can tomato sauce
</li>
<li>1 bay leaf
</li>
<li>1/2tsp. dried oregano
</li>
<li>1/2 tsp. parsley
</li>
<li>1/2 tsp. black pepper
</li>
<li>1/2 tsp. cinnamon
</li>
<li>1/4tsp salt
</li>
<li>1/2 cup red wine
</li>
</ul>
<p>Brown garlic and onions. Add meat and brown. Add spices and tomatoes sauce and simmer for 30 minutes.&nbsp;</p>
<p>In a deep-dish casserole place a little meat sauce to cover the bottom. Then place a layer of eggplant, a layer of meat sauce, a layer of potatoes and alternate until all the eggplant, potatoes, and sauce have been finished. The top layer should be the potatoes.</p>
<p>Bake uncovered in a 350F oven for 1 hour</p>
<p><u>Atkins Version</u>:</p>
<p>Complete this recipe without the potatoes. Use butternut squash as the top layer.</p>
<p>Peel and cube butternut squash. Boil in water until tender, drain. Mash squash and then place on the top layer. Bake. The squash will give this dish a slightly sweet taste. ENJOY!</p>

I want all this html into a memo field in my new Access table. But if I write a ForEach statement, none of the html tags will show up.

The idea is I can create an table using the ForEach command that Access can import.

The html is stored in as a "blob" in the cty file, so I can't use a SELECT statement within Access itself (or can I?).

Any ideas?
-Bob

Bob Bloom
Sunday, March 14, 2004

So, you already have lots of recipies in your citydesk cty file I think.  And you want to as automatically as possible copy all of them into another access database?

How about creating a template with a foreach loop that will write the body of each recipe one after the next into a large html file.  between each body, write some sort of end of recipe marker, then start of recipe marker.

Publish the file on your machine.  Now, write something in access that reads this file, looks for start and end markers, and copies all the html into wherever you want in the access db.

joel goldstick
Monday, March 15, 2004

Bob, what you want to accomplish cannot be currently done with CityScript based on what has been revealed to-date. I also suspect that CityScript may never have that ability -- cause that functionality is somewhat of an advanced function -- the target market for CD [up to this point] has not been the "developer".

BLOB's can be manipulated if one understands how to build COM "controls" -- something I have not learned how to do as yet. The idea with BLOB's is the ability to mix various "data types" to overcome the limitations of the "memo" field -- blobs are much more extensible. This does not help you. Someone knowledgeable in "C" or VB.Net could write a routine that accomplishes what you desire but it does require 1 or 3 hours of work.

David Mozer
Monday, March 15, 2004

There is no way via CityScript.

There is a post with VB functions to get to the BLOB (starring Steve McQueen), but I can't find it (of course). I don't know what to do with the functions anyways :-(

I copy-pasted the 50 odd records.

Thanks for your posts!

Bob Bloom
Monday, March 15, 2004

*  Recent Topics

*  Fog Creek Home