programmability extension

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

programmability extension

C Kirkman
Has anyone used the programmability extension in 14.0 to unzip files? I
know this can be done in SAS, but haven't figured it out in SPSS.

Currently before importing text file into SPSS, I have to 1) unzip file;
2) extract file; 3) enter password to complete the extraction (file is
password protected); 4) save the file. Then I import into SPSS using
syntax.

I would like to be able to do all of this in one program/step. Any
suggestions?
Reply | Threaded
Open this post in threaded view
|

Re: programmability extension

Richard Ristow
At 01:51 PM 9/8/2006, C Kirkman wrote:

>Has anyone used the programmability extension in 14.0 to unzip files?

I haven't. However, the code in a BEGIN PROGRAM/END PROGRAM block is
full Python code. You can do everything there that you can ever do in
Python.

It's hard to imagine that there's no Python module to unzip files. I
refer you to http://python.org/pypi , the "Python cheese shop":

"The Python Cheese Shop is a repository of software for the Python
programming language. There are currently 1597 packages here."

Lovely. You can do a text search for ZIP. There's also a link for
"Browse the tree" or some such - bother; I tried it, and it's not much
help.

I assume you can invoke external ZIP programs, if they'll run from the
command line.

Wish I could give you better, but maybe this will be a start.

Good luck,
Richard Ristow
Reply | Threaded
Open this post in threaded view
|

Re: programmability extension

Roberts, Michael
Hi,

This is what I found on the site - I have not tried it yet, so not sure,
but it looks promising.

http://docs.python.org/lib/module-zipfile.html

HTH

Mike

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Richard Ristow
Sent: Monday, September 11, 2006 2:11 PM
To: [hidden email]
Subject: Re: programmability extension

At 01:51 PM 9/8/2006, C Kirkman wrote:

>Has anyone used the programmability extension in 14.0 to unzip files?

I haven't. However, the code in a BEGIN PROGRAM/END PROGRAM block is
full Python code. You can do everything there that you can ever do in
Python.

It's hard to imagine that there's no Python module to unzip files. I
refer you to http://python.org/pypi , the "Python cheese shop":

"The Python Cheese Shop is a repository of software for the Python
programming language. There are currently 1597 packages here."

Lovely. You can do a text search for ZIP. There's also a link for
"Browse the tree" or some such - bother; I tried it, and it's not much
help.

I assume you can invoke external ZIP programs, if they'll run from the
command line.

Wish I could give you better, but maybe this will be a start.

Good luck,
Richard Ristow