Forum Moderators: coopster

Message Too Old, No Replies

Browsing thru files

How to make a script to parse my files

         

Twixly

9:30 am on Jul 18, 2006 (gmt 0)

10+ Year Member



Hello,

I just managed to create the XML parser I was looking for, now I can take the XML files I want and extract the data and its ready to insert it into mySQL. Sofar all good.

But I have a few folders with alot of files that have random names! So is there any way I can make a script to cycle thru all files and parse them one by one?

the_nerd

12:06 pm on Jul 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



something like this?

$mypath = " ......" ;
$tmpdir = dir ($mypath);

while ($myfile=$tmpdir->read()) {
if (Is_File ($mypath . $myfile)) {
echo $myfile;
}
}

Twixly

12:35 pm on Jul 18, 2006 (gmt 0)

10+ Year Member



Hum, will try when I am home..

but this wont go deeper then one folder would it?

the structure is "#*$!/yyy" and in "yyy" folder there is maybe 20 folders, each containing 100-400 files, but no more folders :)