| Author |
Excell to html tables
|
|
|
| I have a client who needs to insert Excell created "tables" into a
web page. They'll be doing this themselves literally from the field.
Currently he is exporting this to word and having word make html out
of it. I'm running a couple of regexes to strip out the worst of the MS
debris.
I don't think it looks too bad:
<URL: http://socctoberfest.org/schedules_...sults/test.html />
No comments on the layout html please as I did not write this and can
not change it. You can advise on the embedded table though as I control
that. (I suspect I'll regret that)
Anyone have any experience with directly making html out of Excell?
What I've seen so far is a bigger mess than word! I'd like to cut out
one step...
Jeff
| |
|
| Jeff wrote:
> I have a client who needs to insert Excell created "tables" into a
> web page. They'll be doing this themselves literally from the field.
>
> Currently he is exporting this to word and having word make html out
> of it. I'm running a couple of regexes to strip out the worst of the MS
> debris.
>
> I don't think it looks too bad:
>
> <URL: http://socctoberfest.org/schedules_...sults/test.html />
>
> No comments on the layout html please as I did not write this and can
> not change it. You can advise on the embedded table though as I control
> that. (I suspect I'll regret that)
>
> Anyone have any experience with directly making html out of Excell?
> What I've seen so far is a bigger mess than word! I'd like to cut out
> one step...
He could try and use Open Office instead. The output when exported to
xhtml is valid code (except I had to take out the XML prolog which
threw an error in the browser), no MS stuff. Still very bloated
though, and using cm for width and pt for font-size.
Example: http://locusmeus.com/temp/socctober.html
Inside the OpenOffice folder you can find this file:
\share\xslt\export\xhtml\table.xsl
If you know XSLT, you could probably make a few changes in that file
to get rid of most of the bloat.
--
Els http://locusmeus.com/
| |
| GreyWyvern 2007-10-24, 6:18 pm |
| And lo, Jeff didst speak in alt.www.webmaster:
> I have a client who needs to insert Excell created "tables" into a
> web page. They'll be doing this themselves literally from the field.
>
> Currently he is exporting this to word and having word make html out
> of it. I'm running a couple of regexes to strip out the worst of the MS
> debris.
[snip]
> Anyone have any experience with directly making html out of Excell?
> What I've seen so far is a bigger mess than word! I'd like to cut out
> one step...
Why not reverse your middle step? Instead of exporting bloated junk and
stripping away everything bad, tell your client to export the tables as
comma-separated values (CSV) - which Excel does quite nicely - then run
that output through a script which generates a clean table.
Grey
--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollary that nothing is ridiculous.
- http://www.greywyvern.com/orca#search - Orca Search: Full-featured
spider and site-search engine
| |
| Scott Bryce 2007-10-24, 6:18 pm |
| Jeff wrote:
> Anyone have any experience with directly making html out of Excell?
> What I've seen so far is a bigger mess than word! I'd like to cut out
> one step...
Someone has posted a good solution for exporting tables from WORD
documents at comp.infosystems.www.authoring.html this morning.
| |
| Ed Jay 2007-10-24, 6:18 pm |
| GreyWyvern scribed:
>And lo, Jeff didst speak in alt.www.webmaster:
>
>
>[snip]
>
>
>Why not reverse your middle step? Instead of exporting bloated junk and
>stripping away everything bad, tell your client to export the tables as
>comma-separated values (CSV) - which Excel does quite nicely - then run
>that output through a script which generates a clean table.
>
Perl has a module available to do this.
<http://lena.franken.de/perl_hier/excel.html>
--
Ed Jay (remove 'M' to respond by email)
| |
|
| GreyWyvern wrote:
> And lo, Jeff didst speak in alt.www.webmaster:
>
>
>
> [snip]
>
>
>
> Why not reverse your middle step? Instead of exporting bloated junk
> and stripping away everything bad, tell your client to export the
> tables as comma-separated values (CSV) - which Excel does quite nicely
> - then run that output through a script which generates a clean table.
That actually was the original plan. But when I saw the spreadsheet I
thought differently of it and went with the clients idea.
I don't know about you guys, but periodically I have to import
someones data from a spreadsheet to seed a site. These are always full
of comments and never seem to have the same data in the same columns.
The other imports that have to be made are in somewhat different
"formats". It always seems easier to adapt to a clients data than have
him adapt!
With that said, I'll take a look at the module Ed Jay has posted.
Since I'm not stuffing a database, that may be ideal.
Thanks,
Jeff
>
> Grey
>
| |
|
| Els wrote:
> Jeff wrote:
<snip>
>
>
> He could try and use Open Office instead. The output when exported to
> xhtml is valid code (except I had to take out the XML prolog which
> threw an error in the browser), no MS stuff. Still very bloated
> though, and using cm for width and pt for font-size.
> Example: http://locusmeus.com/temp/socctober.html
Thanks, that can be cleaned easily:
$content=~s/style=".*?"//gs;
>
> Inside the OpenOffice folder you can find this file:
> \share\xslt\export\xhtml\table.xsl
> If you know XSLT, you could probably make a few changes in that file
> to get rid of most of the bloat.
Time is short, I got this yesterday, and it's due now. So I'll save this
idea for a future project, as the learning curve is a little long.
I haven't used Open Office yet. How do you find the conversion for MS
Office users is? (I personally try to stay away from anything that
isn't a text or image editor).
BTW, I've browsed your site before for ideas before. Thanks.
Jeff
>
| |
|
| Jeff wrote:
> Els wrote:
[XHTML exported from OpenOffice spreadsheet]
>
> Thanks, that can be cleaned easily:
>
> $content=~s/style=".*?"//gs;
Even better :-)
> I haven't used Open Office yet. How do you find the conversion for MS
> Office users is?
For me it was very easy, but that could be because at least 5 years
passed between the last time I used Excel and the first time I used
Open Office.
> BTW, I've browsed your site before for ideas before. Thanks.
You're welcome :-)
--
Els http://locusmeus.com/
| |
| Brian Cryer 2007-10-25, 6:18 am |
| "Jeff" <dont_bug_me@all.uk> wrote in message
news:13hue3f37b1te80@corp.supernews.com...
> I have a client who needs to insert Excell created "tables" into a web
> page. They'll be doing this themselves literally from the field.
>
> Currently he is exporting this to word and having word make html out of
> it. I'm running a couple of regexes to strip out the worst of the MS
> debris.
>
> I don't think it looks too bad:
>
> <URL: http://socctoberfest.org/schedules_...sults/test.html />
I get 404 Not found.
> No comments on the layout html please as I did not write this and can not
> change it. You can advise on the embedded table though as I control that.
> (I suspect I'll regret that)
>
> Anyone have any experience with directly making html out of Excell? What
> I've seen so far is a bigger mess than word! I'd like to cut out one
> step...
I have a similar need. I wrote a simple application a couple of years ago
that would read the data from Excel and copy it to a marker in an HTML file.
This worked well enough for my needs ... but because I was treating the
Excel spreadsheet as a database and not opening it using the various
automation techniques I don't have access to any of the formatting
information. If just a text dump (into a table) is all that you need then
drop me an email c/o my website and I'll email you it and instructions
(minimal that those will be).
--
Brian Cryer
www.cryer.co.uk/brian
|
|
|
|
| Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |