cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
poweruser87
Level I

Can JMP open .zip archive contents?

Hello,

I have a .zip archive with some tab delimited data saved as text files inside.  I am wondering if there is a way JMP can open one of these text files as a data table directly from the .zip file.  Based on the documentation I'm reading it sounds like this might be possible:

http://www.jmp.com/support/help/Utility_Functions.shtml  --> see Open() and the Zip arg

http://www.jmp.com/support/help/Other_Objects.shtml#1931138

For some reason I cannot figure out the syntax for this, does anyone know more?

I have a path to the .zip file on my local pc and a name of one of the text files I would like to import.  For sake of example let's call them:

path = C:\ZipArchive

file = test1.txt

Any help would be greatly appreciated.  Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: Can JMP open .zip archive contents?

I got some code from Peter W a while back that will do what you want.  To make this work, save a few text file datasets (e.g. csv format) into Big Class.zip.  Then run the following code:

zipdt = open("c:\temp\Big Class.zip", Zip);

zip_member_list = zipdt << dir;

// Open each member file

for (i = 1, i <= nitems(zip_member_list), i++,

      zip_file = zipdt << read(zip_member_list[i], format(blob));

// Open the file

      dt = open(zip_file, text);

);

View solution in original post

2 REPLIES 2
pmroz
Super User

Re: Can JMP open .zip archive contents?

I got some code from Peter W a while back that will do what you want.  To make this work, save a few text file datasets (e.g. csv format) into Big Class.zip.  Then run the following code:

zipdt = open("c:\temp\Big Class.zip", Zip);

zip_member_list = zipdt << dir;

// Open each member file

for (i = 1, i <= nitems(zip_member_list), i++,

      zip_file = zipdt << read(zip_member_list[i], format(blob));

// Open the file

      dt = open(zip_file, text);

);

poweruser87
Level I

Re: Can JMP open .zip archive contents?

Works great.  Thanks!