PC Review


Reply
Thread Tools Rate Thread

Convert HTML table to CSV?

 
 
Steve Ericson
Guest
Posts: n/a
 
      3rd Oct 2005
Perhaps a silly question and I don't know if it can be done. Is there
freeware to convert HTML tables to CSV (or spreadsheet) files?

Steve Ericson
 
Reply With Quote
 
 
 
 
Susan Bugher
Guest
Posts: n/a
 
      3rd Oct 2005
Steve Ericson wrote:

> Perhaps a silly question and I don't know if it can be done. Is there
> freeware to convert HTML tables to CSV (or spreadsheet) files?


http://www.pricelesswarehome.org/acf...oTextAndTables

HTML2Table; HTMStrip

Program: HTML2Table
Author: (Stefan Pettersson)
Ware: (Donationware)
http://www.stefan-pettersson.nu/

Program: HTMStrip
Author: Wayne Software (Bruce Guthrie)
Ware: (Freeware)
http://users.erols.com/waynesof/bruce.htm


Susan
--
Posted to alt.comp.freeware
Search alt.comp.freeware (or read it online):
http://www.google.com/advanced_group....comp.freeware
Pricelessware & ACF: http://www.pricelesswarehome.org
Pricelessware: http://www.pricelessware.org (not maintained)
 
Reply With Quote
 
Steve Ericson
Guest
Posts: n/a
 
      3rd Oct 2005
Susan Bugher <(E-Mail Removed)> wrote

> > Perhaps a silly question and I don't know if it can be done. Is there
> > freeware to convert HTML tables to CSV (or spreadsheet) files?

>
> http://www.pricelesswarehome.org/acf...oTextAndTables
>
> HTML2Table;


Doesn't run on my system, get's stuck during the attempted conversion.

> HTMStrip


Can't get it to do what I want, that is producing a table which I can
import into a simple database (CSV) or spreadsheet.

Thanks for the reply, Susan.

Steve
 
Reply With Quote
 
Susan Bugher
Guest
Posts: n/a
 
      3rd Oct 2005
Steve Ericson wrote:

> Susan Bugher <(E-Mail Removed)> wrote
>
>
>>>Perhaps a silly question and I don't know if it can be done. Is there
>>>freeware to convert HTML tables to CSV (or spreadsheet) files?

>>
>>http://www.pricelesswarehome.org/acf...oTextAndTables
>>
>>HTML2Table;


> Doesn't run on my system, get's stuck during the attempted conversion.


>>HTMStrip

>
> Can't get it to do what I want, that is producing a table which I can
> import into a simple database (CSV) or spreadsheet.


Thanks for the feedback. You might try:

Program: HTML2TXT
Author: BobSoft.com (Yang Bo)
Ware: (Liteware)
http://www.bobsoft.com/h2t/

Susan
--
Posted to alt.comp.freeware
Search alt.comp.freeware (or read it online):
http://www.google.com/advanced_group....comp.freeware
Pricelessware & ACF: http://www.pricelesswarehome.org
Pricelessware: http://www.pricelessware.org (not maintained)
 
Reply With Quote
 
Steve Ericson
Guest
Posts: n/a
 
      4th Oct 2005
Susan Bugher <(E-Mail Removed)> wrote:

> You might try:
>
> Program: HTML2TXT
> Author: BobSoft.com (Yang Bo)
> Ware: (Liteware)
> http://www.bobsoft.com/h2t/


Thanks, Susan. I tried it, but the output file was html as well.
Besides, the interface is hopeless, with a disappearing menu.

Steve
 
Reply With Quote
 
Margrave of Brandenburg
Guest
Posts: n/a
 
      4th Oct 2005
Yeah. I tried it, too. Sux.

"Steve Ericson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Susan Bugher <(E-Mail Removed)> wrote:
>
> > You might try:
> >
> > Program: HTML2TXT
> > Author: BobSoft.com (Yang Bo)
> > Ware: (Liteware)
> > http://www.bobsoft.com/h2t/

>
> Thanks, Susan. I tried it, but the output file was html as well.
> Besides, the interface is hopeless, with a disappearing menu.



 
Reply With Quote
 
Margrave of Brandenburg
Guest
Posts: n/a
 
      4th Oct 2005
"Steve Ericson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks, Susan. I tried it, but the output file was html as well.
> Besides, the interface is hopeless, with a disappearing menu.
>
> Steve


If you have Cygwin for Windows (it's free), you can write a shell script
that will do what you want. Here's a first shot at such a script. It does a
pretty good job. I prefer tab-delimited files over comma-delimited, so
that's what this does.

It runs pretty slowly, but WTF?

When cuttting and pasting the code, take care NOT to create any blanks at
the end of any line of code (especially after the \ character), or it won't
work.

--- cut here ---
#!/bin/ksh

# table2text
#
# usage: table2text file-name
#
# Eliminates (almost) all HTML garbage from a file,
# keeping only the text contents of a <table>.
#
# It's not (yet) smart enough to eliminate the text
# of embedded style-sheets.

case $# in
1) file="$1";;
*) exit 1;;
esac

cat "$file" | \
sed -e "s,\~,,g" \
-e "s,<[Tt][Aa][Bb][Ll][Ee][^>]*>,\~TABLE\~,g" \
-e "s,</[Tt][Aa][Bb][Ll][Ee][^>]*>,\~/TABLE\~,g" \
-e "s,<[Tt][Rr][^>]*>,\~TR\~,g" \
-e "s,</[Tt][Rr][^>]*>,\~/TR\~,g" \
-e "s,<[Tt][Dd][^>]*>,\~TD\~,g" \
-e "s,</[Tt][Dd][^>]*>,\~/TD\~,g" \
-e "s,</*[^>]*>,,g" \
-e "s,\&nbsp;, ,g" \
-e "s, *$,," \
-e "s,^ *,," \
-e "s, *, ,g" | \
grep -v "^$" | \
while read instrg
do
outstrg=`echo "$instrg" | \
sed -e "s,\~/TABLE\~,,g" \
-e "s,\~/TR\~,\~,g" \
-e "s,\~/TD\~, ,g" \
-e "s,\~TABLE\~,\~,g" \
-e "s,\~TR\~,,g" \
-e "s,\~TD\~,,g"`
echo "$outstrg\c"
done | \
tr "~" "\012"

exit 0
--- cut here ---


 
Reply With Quote
 
ggrothendieck@gmail.com
Guest
Posts: n/a
 
      4th Oct 2005
Select table in IE (maybe other browsers too) and in
Open Office Calc 2.0 (maybe earlier versions too) click
on upper left cell and use Edit | Paste Special |
HTML Format | OK to paste it into the spreadsheet.
Now save it as a CSV file.

(In Excel its even easier since you can paste it into
Excel using just ctrl-V).

 
Reply With Quote
 
ggrothendieck@gmail.com
Guest
Posts: n/a
 
      4th Oct 2005
In the previous instructiions I neglected to explicitly
say that you need to copy it to the cliipboard although
it was probably obvious. Just in case here are
revised instructions:

Select table in IE (maybe other browsers too) and press
ctrl-C to copy the selection to the Windows clipboard.
In Open Office Calc 2.0 (maybe earlier versions too)
click on upper left cell and use Edit | Paste Special |
HTML Format | OK to paste clipboard into the spreadsheet.
Now save it as a CSV file.

(In Excel its even easier since you can paste it into
Excel using just ctrl-V).

 
Reply With Quote
 
Susan Bugher
Guest
Posts: n/a
 
      4th Oct 2005
Margrave of Brandenburg wrote:
> "Steve Ericson" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>Susan Bugher <(E-Mail Removed)> wrote:


>>>You might try:
>>>
>>>Program: HTML2TXT
>>>Author: BobSoft.com (Yang Bo)
>>>Ware: (Liteware)
>>>http://www.bobsoft.com/h2t/


>>Thanks, Susan. I tried it, but the output file was html as well.
>>Besides, the interface is hopeless, with a disappearing menu.


> Yeah. I tried it, too. Sux.


ACK. I won't suggest that app again. Thanks for the feedback.

Susan
--
Posted to alt.comp.freeware
Search alt.comp.freeware (or read it online):
http://www.google.com/advanced_group....comp.freeware
Pricelessware & ACF: http://www.pricelesswarehome.org
Pricelessware: http://www.pricelessware.org (not maintained)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I convert an html table into a gif file for use as a logo? =?Utf-8?B?YmR1bmF3YXk=?= Microsoft Frontpage 2 23rd Apr 2007 12:24 AM
Convert html table to ods ( OpenOffice Spreadsheet ) HokBen Microsoft ASP .NET 0 9th Nov 2006 03:46 AM
How do I convert HTML table copied into a Word Doc - into Excel? =?Utf-8?B?V09SRCBUYWJsZSBpbnRvIEV4Y2Vs?= Microsoft Word Document Management 2 12th Jul 2006 11:51 AM
Convert excel table to HTML =?Utf-8?B?TG/Dr2M=?= Microsoft Excel Misc 4 17th Oct 2005 09:44 PM
Convert HTML table to CSV Fran Freeware 0 29th Feb 2004 08:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:43 PM.