ZIP files

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
snapper1969
Pro Scripter
Posts: 50
Joined: Fri Mar 23, 2007 10:14 am

ZIP files

Post by snapper1969 » Mon Aug 04, 2008 3:31 pm

Hi,

Would it be possible to do the following?:

Every month 30 .xls files are generated in a directory. They have to be zipped up into 4 different zip files and emailed to various clients.

The files are kept in the directory so there are quite a few in there from months gone by. Is it possible to zip up files with wildcards and also depending on the date created i.e

test123.xls
test234.xls
test345.xls

old123.xls
old234.xls
old345.xls

I'd like to zip up the old345.xls file and the test345xls file which were both created on the same day.

Thx,

John

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Aug 04, 2008 3:58 pm

Quick answer is YES, it will be possible to do that.

If using WinZip, you should look at downloading the command line utility, wzcline.exe, which may be easier to use vs. navigating through windows.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Mon Aug 04, 2008 4:22 pm

If you don't have a winzip license you can use 7-Zip which has good command line features.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Aug 04, 2008 4:42 pm

Or use Macro Scheduler's zip library:
http://www.mjtnet.com/plugins.htm
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

snapper1969
Pro Scripter
Posts: 50
Joined: Fri Mar 23, 2007 10:14 am

ZIP

Post by snapper1969 » Tue Aug 05, 2008 7:24 am

Thx Guys,

Marcus - Can the zip plugin add files to a Winzip 9 file?.

Thx,

John

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: ZIP

Post by Marcus Tettmar » Tue Aug 05, 2008 8:40 am

snapper1969 wrote:Thx Guys,

Marcus - Can the zip plugin add files to a Winzip 9 file?.

Thx,

John
Yes.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

snapper1969
Pro Scripter
Posts: 50
Joined: Fri Mar 23, 2007 10:14 am

Zip Fliles

Post by snapper1969 » Tue Aug 05, 2008 3:09 pm

Hi,

I was wondering if the following would be the best way to achieve what I want:

Run>cmd /c dir "T:\test\global\widget1.*" /o-d /b > T:\test\global\zip\list1.txt
ReadLn>T:\test\global\zip\list1.txt,1,NewFile1
LibLoad>%SCRIPT_DIR%\Ziplib.dll,hZL
LibFunc>hZL,AddFiles,r,T:\test\global\zip\newfiles1*.zip,T:\test\global\zip\%NewFile1%,9,0

There will be a list of 30 files that I will need to process like this with them being split up between 4 different zip files. Do I need to do as above and do this block for each file?.

Thx,

John

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Aug 05, 2008 3:25 pm

Not sure what you're trying to do there - you can't have a wildcard in a zip file.

I would also use GetFileList and Separate to loop through the files, rather than DOS.

Don't forget to LibFree at the end.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

snapper1969
Pro Scripter
Posts: 50
Joined: Fri Mar 23, 2007 10:14 am

Zip files

Post by snapper1969 » Wed Aug 06, 2008 7:39 am

Marcus,

I need to be able to get the particular file from the wildcard that was generated that day, that's why I was going to use the DOS command as that puts the latest file at the top of the list generated. I'm not at my own computer today but does getfilelist do this?.

thx,

john

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts