ASP FSO File Name Problem

ASP FSO File Name Problem

am 25.07.2007 17:52:14 von Ken

I have a script that reads a directory and creates a xml doc based on
that directory. I just got the file count and walked through it adding
lines to the xml.
I used
While int(filecount) >= b
xml_to_silo_string3 = xml_to_silo_string3 & ""
xml_to_silo_string3 = xml_to_silo_string3 & "0-" & tempPageNumber
& "
"
tempPageNumber = tempPageNumber + 1

b = b+1
Wend
Now we need to have both jpegs and tiffs in the directory. So I need
to get the extensions. No problem right? .... wrong the files are
named 01, 02, 03, 04 .... 010 etc.. and they have to stay in order in
xml. So I tried

For each file in files_collection
xml_to_silo_string3 = xml_to_silo_string3 & ""
xml_to_silo_string3 = xml_to_silo_string3 & file.Name & "
&">"
b = b+1
Next

But that gives me file 01 then 010 then 011 not 01, 02, 03 which is
what I need.

Does anybody know how to loop through the directory sequentially?
thanks ;)

Re: ASP FSO File Name Problem

am 25.07.2007 20:30:14 von Jon Paal

you may instead want to loop through the files and rename them correctly or you will be fighting this problem forever...


"KEN" wrote in message news:1185378734.316041.304320@57g2000hsv.googlegroups.com...
>I have a script that reads a directory and creates a xml doc based on
> that directory. I just got the file count and walked through it adding
> lines to the xml.
> I used
> While int(filecount) >= b
> xml_to_silo_string3 = xml_to_silo_string3 & ""
> xml_to_silo_string3 = xml_to_silo_string3 & "0-" & tempPageNumber
> & "
"
> tempPageNumber = tempPageNumber + 1
>
> b = b+1
> Wend
> Now we need to have both jpegs and tiffs in the directory. So I need
> to get the extensions. No problem right? .... wrong the files are
> named 01, 02, 03, 04 .... 010 etc.. and they have to stay in order in
> xml. So I tried
>
> For each file in files_collection
> xml_to_silo_string3 = xml_to_silo_string3 & ""
> xml_to_silo_string3 = xml_to_silo_string3 & file.Name & "
> &">"
> b = b+1
> Next
>
> But that gives me file 01 then 010 then 011 not 01, 02, 03 which is
> what I need.
>
> Does anybody know how to loop through the directory sequentially?
> thanks ;)
>