Page 1 of 1 1
Topic Options
#169000 - 2006-10-06 05:53 PM loop dates
brewdude6 Offline
Hey THIS is FUN

Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
I've got a folder with an enormous amount of pdf files (small file size, just a lot of them). I plan on creating an array of filenames for each day and use 7-zip to zip them by day. Is there a way to pick a starting date and increment through the files for each day?
_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs.
-Mark Twain

Top
#169001 - 2006-10-06 08:15 PM Re: loop dates
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
As an idea, Use the DirPlus UDF and then if the date is = specified date add to an array that you can then use to make your zip file.
Top
#169002 - 2006-10-07 12:26 AM Re: loop dates
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
hmm, something could be done using Dirplus, and one of the time UDF's.

Here is something using flipctime() just because i know that one
Code:
$files = dirplus("c:\pdf files",'/a-d /f pdf')

$startdate = '2005/12/01'
$endDate = '2006/1/01'


for each $file in $files
;change the time to 24h
$time = timeconvert(split($file.DateLastModified)[1] + split($file.DateLastModified)[2])

;reset date to yyyy/MM/DD
$date = split($file.DateLastModified)[0]
$date = split($date,'/')
$date = $date[2]+'/'+$date[0]+'/'+$date[1]

$filedate = flipctime($date, $time)
if $filedate > flipctime($startDate,'00:00') and $filedate < flipctime($enddate,'00:00')
? $file
endif
next



grab the UDFs timeconvert, dirplus, and flipctime...

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.127 seconds in which 0.093 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org