Excel to clean and minimal html

Discussion in 'HTML' started by KiwiBrian, Aug 24, 2008.

  1. KiwiBrian

    KiwiBrian Guest

    Is there a program that will convert an excel file to a clean html table
    without the extra formatting crud that excel includes.
    I just want the raw data in a minimal html table so that I can add my own
    CSS to style it.
     
    KiwiBrian, Aug 24, 2008
    #1
    1. Advertising

  2. On 2008-08-24, KiwiBrian wrote:
    > Is there a program that will convert an excel file to a clean html table
    > without the extra formatting crud that excel includes.
    > I just want the raw data in a minimal html table so that I can add my own
    > CSS to style it.


    Save the table as a CSV (comma-separated values) file and run it
    through a script such as this:

    echo "<table>"
    awk -F, '{
    print "<tr>"
    n = 0
    while ( ++n <= NF ) printf " <td>%s</td>\n", $n
    print "</tr>"
    }
    '
    echo "</table>"


    --
    Chris F.A. Johnson, webmaster <http://Woodbine-Gerrard.com>
    ===================================================================
    Author:
    Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
     
    Chris F.A. Johnson, Aug 24, 2008
    #2
    1. Advertising

  3. KiwiBrian

    dorayme Guest

    In article <d1c5e$48b10804$cef88ba3$>,
    "Chris F.A. Johnson" <> wrote:

    > On 2008-08-24, KiwiBrian wrote:
    > > Is there a program that will convert an excel file to a clean html table
    > > without the extra formatting crud that excel includes.
    > > I just want the raw data in a minimal html table so that I can add my own
    > > CSS to style it.

    >
    > Save the table as a CSV (comma-separated values) file and run it
    > through a script such as this:
    >
    > echo "<table>"
    > awk -F, '{
    > print "<tr>"
    > n = 0
    > while ( ++n <= NF ) printf " <td>%s</td>\n", $n
    > print "</tr>"
    > }
    > '
    > echo "</table>"


    I have used similar and it works very well indeed. Recommended. It is
    also very good in that maintenance is minimal if you are being supplied
    big tables that need updated from a client. Ask them to supply in CSV
    format.

    --
    dorayme
     
    dorayme, Aug 24, 2008
    #3
  4. KiwiBrian

    KiwiBrian Guest

    "dorayme" <> wrote in message
    news:...
    > In article <d1c5e$48b10804$cef88ba3$>,
    > "Chris F.A. Johnson" <> wrote:
    >
    >> On 2008-08-24, KiwiBrian wrote:
    >> > Is there a program that will convert an excel file to a clean html
    >> > table
    >> > without the extra formatting crud that excel includes.
    >> > I just want the raw data in a minimal html table so that I can add my
    >> > own
    >> > CSS to style it.

    >>
    >> Save the table as a CSV (comma-separated values) file and run it
    >> through a script such as this:
    >>
    >> echo "<table>"
    >> awk -F, '{
    >> print "<tr>"
    >> n = 0
    >> while ( ++n <= NF ) printf " <td>%s</td>\n", $n
    >> print "</tr>"
    >> }
    >> '
    >> echo "</table>"

    >
    > I have used similar and it works very well indeed. Recommended. It is
    > also very good in that maintenance is minimal if you are being supplied
    > big tables that need updated from a client. Ask them to supply in CSV
    > format.


    Thanks chaps.
    Are you able to pont me to a page that describes the
    methodology/implentation of running such a "script"?
     
    KiwiBrian, Aug 24, 2008
    #4
  5. KiwiBrian wrote:
    > Is there a program that will convert an excel file to a clean html table
    > without the extra formatting crud that excel includes.
    > I just want the raw data in a minimal html table so that I can add my own
    > CSS to style it.
    >
    >

    Using a simple text editor like metapad where you can search on carriage
    returns and tabs it can be simply done. Or you can do it in Word.

    Select the cells in Excel and past as text.

    The pasted contents is tab delimited.

    for metapad 2 S&R operations.

    Search: \n Replace: </td></tr>\n<tr><td>
    Search: \t Replace: </td><td>

    Start with: <table>
    End with: </table>

    Done.

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Aug 24, 2008
    #5
  6. On 2008-08-24, KiwiBrian wrote:
    >
    > "dorayme" <> wrote in message
    > news:...
    >> In article <d1c5e$48b10804$cef88ba3$>,
    >> "Chris F.A. Johnson" <> wrote:
    >>
    >>> On 2008-08-24, KiwiBrian wrote:
    >>> > Is there a program that will convert an excel file to a clean html
    >>> > table
    >>> > without the extra formatting crud that excel includes.
    >>> > I just want the raw data in a minimal html table so that I can add my
    >>> > own
    >>> > CSS to style it.
    >>>
    >>> Save the table as a CSV (comma-separated values) file and run it
    >>> through a script such as this:
    >>>
    >>> echo "<table>"
    >>> awk -F, '{
    >>> print "<tr>"
    >>> n = 0
    >>> while ( ++n <= NF ) printf " <td>%s</td>\n", $n
    >>> print "</tr>"
    >>> }
    >>> '
    >>> echo "</table>"

    >>
    >> I have used similar and it works very well indeed. Recommended. It is
    >> also very good in that maintenance is minimal if you are being supplied
    >> big tables that need updated from a client. Ask them to supply in CSV
    >> format.

    >
    > Thanks chaps.
    > Are you able to pont me to a page that describes the
    > methodology/implentation of running such a "script"?


    It runs in a UNIX shell.

    With a slight modification, it can be run with just the AWK
    programming langauge:

    awk -F, '
    BEGIN { print "<table>" }
    {
    print "<tr>"
    n = 0
    while ( ++n <= NF ) printf " <td>%s</td>\n", $n
    print "</tr>"
    }
    END { print "</table>" }
    '


    --
    Chris F.A. Johnson, webmaster <http://Woodbine-Gerrard.com>
    ===================================================================
    Author:
    Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
     
    Chris F.A. Johnson, Aug 24, 2008
    #6
  7. KiwiBrian

    KiwiBrian Guest

    Thanks very much Ed.
    Looks like the best solution so far.
    Will try using your method in conjunction with Dreamweaver.

    "Ed Mullen" <> wrote in message
    news:...
    > KiwiBrian wrote:
    >> Is there a program that will convert an excel file to a clean html table
    >> without the extra formatting crud that excel includes.
    >> I just want the raw data in a minimal html table so that I can add my own
    >> CSS to style it.

    >
    > Here's what I do.
    >
    > - Save the Excel sheet as a CSV (comma delimited) file (it's plain text).
    >
    > - Open that file in a text editor. Highlight and Copy all the text.
    >
    > - Open Kompozer, Nvu, or the Composer in SeaMonkey/Mozilla Suite. Paste
    > the text into a "Normal" view window.
    >
    > - Highlight all the text. Click Table - Create Table from selection.
    >
    > I then go to the "Source" view in Kompozer, highlight and copy the table
    > source, then paste the code into a pre-formatted HTML file.
    >
    > I do this on a regular basis for a couple of tables that periodically
    > change on some of my Web pages.
    >
    > The above may, at first glance, appear complicated. But everything takes
    > me just a couple minutes to go from Excel to the finished Web page
    > uploaded to my server.
    >
    > --
    > Ed Mullen
    > http://edmullen.net
    > Everybody is somebody else's weirdo.
     
    KiwiBrian, Aug 24, 2008
    #7
  8. KiwiBrian

    dorayme Guest

    In article <g8re2l$o5s$>,
    "KiwiBrian" <> wrote:

    > "dorayme" <> wrote in message
    > news:...
    > > In article <d1c5e$48b10804$cef88ba3$>,
    > > "Chris F.A. Johnson" <> wrote:
    > >
    > >> On 2008-08-24, KiwiBrian wrote:
    > >> > Is there a program that will convert an excel file to a clean html
    > >> > table
    > >> > without the extra formatting crud that excel includes.
    > >> > I just want the raw data in a minimal html table so that I can add my
    > >> > own
    > >> > CSS to style it.
    > >>
    > >> Save the table as a CSV (comma-separated values) file and run it
    > >> through a script such as this:
    > >>
    > >> echo "<table>"

    ....
    > > I have used similar and it works very well indeed. Recommended. It is
    > > also very good in that maintenance is minimal if you are being supplied
    > > big tables that need updated from a client. Ask them to supply in CSV
    > > format.

    >
    > Thanks chaps.
    > Are you able to pont me to a page that describes the
    > methodology/implentation of running such a "script"?


    Ed's suggestion is perhaps best for you. I endorsed Chris's because I
    use it for more complicated situations. One of these situations is where
    it helps that the client can bypass me and not attracts fees (it being a
    non-profit organization and me being a savage money grabbing no holds
    barred profiteering usuring Cagney type out for anything that I can get
    a claw on...). Most clients are up to Excel but not to good HTML.

    But if you ever have the need, this is how I do I. I put in the php
    script in the html at the point at which I want the table to appear. I
    then simply load up the html to the server along with csv file. In the
    script is a reference to this separate csv file and the php engine on
    the server does the business.

    If you want an example of the html file and a url of the result, you can
    email me.

    --
    dorayme
     
    dorayme, Aug 24, 2008
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Toby Inkster

    Minimal HTML

    Toby Inkster, Nov 24, 2004, in forum: HTML
    Replies:
    19
    Views:
    798
    Mimic
    Nov 26, 2004
  2. =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=

    Problem with Excel reports ::::Excel 2003 Migration To Excel 2007

    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=, Oct 5, 2007, in forum: ASP .Net
    Replies:
    15
    Views:
    1,572
    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=
    Oct 24, 2007
  3. Altu
    Replies:
    2
    Views:
    1,387
    Dimitre Novatchev
    Nov 14, 2007
  4. Replies:
    8
    Views:
    530
  5. Andy Chu
    Replies:
    1
    Views:
    952
    Paul Rubin
    Apr 17, 2009
Loading...

Share This Page