Parsing Windows Files/Dir into Mysql

SpaceshipSpaceship
Watch

KwelX

Established Member
Impact
21
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.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
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.
 
0
•••
awesome..thanks.

i'll google it tonight and see what i can do.
 
0
•••
It wouldn't be too hard to do with PHP5's directory recurser either, may I ask why you want to do this?
 
0
•••
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.
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer
Appraise.net

We're social

Spaceship
Domain Recover
CatchDoms
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back