 |
Results from the most recent live auction are here.
17 members in the live chat room. Join Chat!
| |
08-02-2005, 11:39 AM
|
· #1 | | NamePros Regular Join Date: Jun 2004
Posts: 363
NP$: 14.00 ( Donate)
| 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. |
| |
08-02-2005, 12:20 PM
|
· #2 | | NamePros Regular Location: Tucson, AZ Join Date: Jul 2005
Posts: 649
NP$: 22.50 ( Donate)
| 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. |
| |
08-02-2005, 12:48 PM
|
· #3 | | NamePros Regular Join Date: Jun 2004
Posts: 363
NP$: 14.00 ( Donate)
| awesome..thanks.
i'll google it tonight and see what i can do. |
| |
08-02-2005, 08:36 PM
|
· #4 | | Account Closed | It wouldn't be too hard to do with PHP5's directory recurser either, may I ask why you want to do this? |
| |
08-02-2005, 09:05 PM
|
· #5 | | NamePros Regular Location: Tucson, AZ Join Date: Jul 2005
Posts: 649
NP$: 22.50 ( Donate)
| 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. |
| |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | |