How do I import raw CSV data into an HTML Table ? (i.e. without the f***ing Microsoft Excel formatt

  • Thread starter Shiperton Henethe
  • Start date
S

Shiperton Henethe

Hi

How do I import an MS Excel table (Office 2002) into Dreamweaver MX2004
without any bloody Micro$oft formatting tags?! - ie just the table structure
& data please!

What doesnt work:
a) Saving the table as a CSV text file and re-importing back into Ms Excel
and then saving as HTML file. When I import into DW it cant take
out all the stray [f***ing] Microsoft characters.


b) Doing the above and importing into Ms Word and then importing into
DW. Because when you then run the tool to clean up Ms Word tags
the damned thing just hangs!!

SURELY there is an easier way by now?!

I used to have a damned useful utility called detagger, but it was to be
fair slightly
fiddly and I've now lost my copy due to a HD crash, in any case.

- Any suggestions?!


Ship
 
T

Toby Inkster

Shiperton said:
How do I import an MS Excel table (Office 2002) into Dreamweaver MX2004
without any bloody Micro$oft formatting tags?!

Open the spreadsheet, save as tab seperated values, open in a decent text
editor.

Do a search and replace with regular expressions:

\t => </td><td>
^ => <tr><td>
$ => </td></tr>

Then add a <table> at the top and a </table> at the end. Job done.
 
J

Jeff North

|
| Hi
|
| How do I import an MS Excel table (Office 2002) into Dreamweaver MX2004
| without any bloody Micro$oft formatting tags?! - ie just the table structure
| & data please!
|
| What doesnt work:
| a) Saving the table as a CSV text file and re-importing back into Ms Excel
| and then saving as HTML file. When I import into DW it cant take
| out all the stray [f***ing] Microsoft characters.
|
|
| b) Doing the above and importing into Ms Word and then importing into
| DW. Because when you then run the tool to clean up Ms Word tags
| the damned thing just hangs!!
|
| SURELY there is an easier way by now?!
|
| I used to have a damned useful utility called detagger, but it was to be
| fair slightly
| fiddly and I've now lost my copy due to a HD crash, in any case.
|
| - Any suggestions?!

File | Import Data then select either Tabular Data for your csv file
or Excel Document for your xls file.
-------------------------------------------------------------------
Leviticus 18:22 (KJV): "Thou shalt not lie with mankind, as with
womankind it is abomination."

Well, "duh!" Men don't often ask "Does this make me look fat?"
So, of course, we don't have to lie with men like we do with women.
 
S

Shiperton Henethe

I just tried the File Import thing - and that makes my DW hang!
And the other string change suggestions leave all sorts of crud behind...

However strangely enough, it turns out that if I
a) save a delimited txt file
b) open it in Excel
and then simply
c) cut and past the cells in question
into an *empty* bit of HTML file in DW,
I get a perfect result. Miracle! So simple I never thought of trying it!


Ship
Shiperton Henethe
 
J

Jim Higson

Toby said:
Open the spreadsheet, save as tab seperated values, open in a decent text
editor.

Do a search and replace with regular expressions:

\t => </td><td>
^ => <tr><td>
$ => </td></tr>

If you have access to UNIX box this command:

cat whatever.csv | sed "s/\t/<\/td><td>/g" | sed "s/^/<tr><td>/g" | \
sed "s/$/<\/td><\/tr>/g" > whatever.htmlbit

should do it. If you don't have UNIX, cygwin on Windows will do.

I know this looks odd, and for a single file is proberbly too much work, but
you could put it in a script and then apply it to many files at once.
 

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