Web Query and Line Break <BR> tags

A

AhBook

Hi there,

I have a problem that I have seen come up a few times in searching
through the archives, but I have not been able to find a solution (if
there is one).

I have a project that I believe an Excel Web Query would be perfect
for, except for one small problem.

When I run a Web Query against a website to pull in a table, and in
that table one of the cells has multiple lines separated by <BR> tags,
Excel puts the multiple lines into separate cells.

The ideal situation would be for it to use the <td> tags as cell
delimiters, not the <br> tags.

Can anyone think of any clever workarounds to this?

Thanks!
 
H

Harlan Grove

AhBook said:
When I run a Web Query against a website to pull in a table, and in
that table one of the cells has multiple lines separated by <BR> tags,
Excel puts the multiple lines into separate cells.

The ideal situation would be for it to use the <td> tags as cell
delimiters, not the <br> tags.

Can anyone think of any clever workarounds to this?

A metaphorical answer. The village idiot (Excel) believes he knows how to
perform particular tasks better than anyone else, and being the village
idiot is incapable of learning otherwise and is adamantly unwilling to
perform those tasks any other way.

Your choices are don't use the village idiot to perform these tasks or get
used to taking the village idiot's work product and converting into the
correct form.

One option would be using the unix-like utility wget to download web pages
to local disk files, use a text filter (Perl or Python would be the best
languages in which to write such a filter) to remove all <BR> tags inside
HTML tables, then run the web query against the local HTML file, using the
file:// directive rather than html://. This is a guess on my part - I've
never tried a web query against a local drive.

The point here is that if Excel thinks <BR> tags should trigger moving down
one row, there's nothing in any normal human's power to get Excel to do
anything else. Microsoft has the unfortunate habbit of writing software that
performs certain tasks 'The One True Way'. This would seem to be one case.
 

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

Top