[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Need to convert HTML tables to CSV file

Posted on 2004-08-04
13
Medium Priority
?
794 Views
Last Modified: 2008-01-09
I need a program to convert html tables into a csv file for conversion into an sql server table. i've seen on program but it was written in VB 3 or something. Has anyone come across anything like that?

Dinesh
0
Comment
Question by:dprasad
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 3
13 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 1000 total points
ID: 11723002
Which language do you prefer?
Here is an example in Perl:
http://www.experts-exchange.com/Programming/Programming_Languages/Perl/Q_20287078.html
And here is another:
http://www.coscorrosa.com/programs/cgi/html2csv/html2csv.pl

I guess it will be easy to translate to PHP or ASP.
0
 
LVL 3

Expert Comment

by:TILL
ID: 11723384
You can use Excel, with Web Import feature. Is the easyest way.
0
 

Author Comment

by:dprasad
ID: 11723932
TIll, I'm using excel 2000, I dont see a web import feature. I tried to open it directly, and also tried pasting as html and text. when i do that, it puts everything in one column on the csv files. how should i do this?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Assisted Solution

by:TILL
TILL earned 1000 total points
ID: 11723968
From Excel menu, go to Data-> Import External Data ->New Web Query.
0
 

Author Comment

by:dprasad
ID: 11723998
I can find a newer copy, Ill try it with that
0
 
LVL 3

Expert Comment

by:TILL
ID: 11724013
When you go to WebQuery you have to enter an URL which can be an internet adress or a local file. You the html file is stored locally, you can enter the URL like file:///c:\test.html
After that, the WebQuery Dialog will show you all the tables that you gave in that HTML file. All you have to do is select de right table, click ok and choose the drpoint of your table. And voila... the document is ready. After that you save it as csv and you're ready to go.;)

Best of luck with that.
TILL
0
 

Author Comment

by:dprasad
ID: 11729048
OK, I got office XP. It works, but because of the way the data is set up in the tables, I don't get it in the right format.
The problem is, on the web page, the data is set up like this
Name:  1999 Cayuse Walla Walla Valley Syrah

Vintage: 1999
Style: Syrah
Vineyard:
Region: Walla Walla, Washington
Description:  blah blah
blah
Size: .750/ml  Qty Available: 3
Store: A Wine Store Washington

with a price in a new column on the right. Also, the description field is variable length. So in excel, everything shows up in the first column. do you know how i could put each data element in its own column without copying and pasting each one? I have about 1,000 of these to put in
0
 

Author Comment

by:dprasad
ID: 11729230
Jaime: I tried running the 2nd perl script you listed. I have lvery limited knowledge in perl, but i can get them to work. I'm seeing the program run and display the information to the screen. But how do i get access to the tables converted into a csv file? whats the command line syntax? Thanks!

Dinesh
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11729299
Just use "Save as..."
0
 

Author Comment

by:dprasad
ID: 11729410
I dont understand, how do I do save as when I run the script?
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11729453
I can't run the script right now, but if you see results in a web browser, just save page as .txt file (changing to .csv extension)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Navigation is an important part of web design from a usability perspective. But it is often a pain when it comes to a developer’s perspective. By navigation, it often means menuing. This is less theory and more practical of how to get a specific gro…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question