[advanced search]
Results from the most recent live auction are here.
17 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming > CODE
User Name
Password

Old 08-02-2005, 11:39 AM   · #1
KwelX
NamePros Regular
 
KwelX's Avatar
 
Trader Rating: (36)
Join Date: Jun 2004
Posts: 363
NP$: 14.00 (Donate)
KwelX is just really niceKwelX is just really niceKwelX is just really niceKwelX is just really nice
Talking Parsing Windows Files/Dir into Mysql

I have some dirs and html files and would like to parse them into a mysql db.

What I would like to do is pull the directory names into a category table, place the contained files into subtables under each dir. then pull data from the html files into tables. such as the h1 data and body onto seperate tables.

Does this make sense and is this possible?

This is what I want to do in a nutshell:

DIR-HTML PAGES
into:
Category
|
File ID - Title - Body
File ID - Title - Body
File ID - Title - Body

However I have several DIR-and 100's of HTML pages. There is a naming convention of the HTML pages that can be used as the File ID.

If anyone has done this or knows how please point me in the right direction for software or a script.

Thanks.


Please register or log-in into NamePros to hide ads
__________________
KwelX is offline   Reply With Quote
Old 08-02-2005, 12:20 PM   · #2
monaco
NamePros Regular
 
monaco's Avatar
 
Location: Tucson, AZ
Trader Rating: (0)
Join Date: Jul 2005
Posts: 649
NP$: 22.50 (Donate)
monaco is on a distinguished road
I would do this in Java with JDBC using mysql Connector/J for the database connectivity.

Pick a directory root, run a recursive breadth-first search to enumerate all the files with full pathnames, parse it to your liking, then insert into the db. I did something similar to this, I'll post the source code if I can find it.
__________________
My Website | My Blog
monaco is offline   Reply With Quote
Old 08-02-2005, 12:48 PM   · #3
KwelX
NamePros Regular
 
KwelX's Avatar
 
Trader Rating: (36)
Join Date: Jun 2004
Posts: 363
NP$: 14.00 (Donate)
KwelX is just really niceKwelX is just really niceKwelX is just really niceKwelX is just really nice
awesome..thanks.

i'll google it tonight and see what i can do.
__________________
KwelX is offline   Reply With Quote
Old 08-02-2005, 08:36 PM   · #4
Refrozen
Account Closed
 
Refrozen's Avatar
 
Trader Rating: (6)
Join Date: Jun 2005
Posts: 747
NP$: 0.50 (Donate)
Refrozen will become famous soon enoughRefrozen will become famous soon enough
It wouldn't be too hard to do with PHP5's directory recurser either, may I ask why you want to do this?
Refrozen is offline   Reply With Quote
Old 08-02-2005, 09:05 PM   · #5
monaco
NamePros Regular
 
monaco's Avatar
 
Location: Tucson, AZ
Trader Rating: (0)
Join Date: Jul 2005
Posts: 649
NP$: 22.50 (Donate)
monaco is on a distinguished road
To do it in php, he'd need to install php, apache/iis, and use a browser to do everything, with no debugger/stepping support.

With java, he just needs to download a jarfile from mysql for the db connector.
__________________
My Website | My Blog
monaco is offline   Reply With Quote
Closed Thread

NamePros is a revenue sharing forum.

Thread Tools

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HOWTO: Install the Apache Web Server, Perl, PHP, and MySQL on Windows deadserious Webmaster Tutorials 96 05-27-2007 01:24 PM
Tutorial: How to Install Apache2 MySQL and PHP on Windows deadserious Webmaster Tutorials 35 09-21-2005 09:46 PM
Tutorial: Getting Started With MySQL (The Basics) deadserious Webmaster Tutorials 3 04-18-2004 01:17 PM

Site Sponsors
Proof is in the Parking NameChatter NameChatter
Advertise your business at NamePros
All times are GMT -7. The time now is 08:39 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0