cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
nmossery
Level II

Open *.JMP.GZ File (gzip)

Hi,

I am working with JMP.GZ Files (GZIP).

when using the command open(file.jmp.gz) the file is unzipped.

when trying to open the file.jmp (unzipped) the file not found .

once I added wait between two commands , it works.

is there any way to know when the open command finished to unzip the file ?

I want it to work on all files sizes and do not want to add high Wait time . 

 

The below code does not work :

 

Open( file_jmp_name_GZIP );// GUNZIP the file

dt = Open( file_jmp_name );// open the unzipped file to dt

 

 

the below code works :

 

Open( file_jmp_name_GZIP );
Wait( 0.5 );
dt = Open( file_jmp_name );

 

1 ACCEPTED SOLUTION

Accepted Solutions
Jeff_Perkinson
Community Manager Community Manager

Re: Open *.JMP.GZ File (gzip)

If you're using gzip to compress the files outside of JMP you may be taking a step that's not necessary. You can save tables in compressed form using an option in the data table.

 

2020-07-28_18-18-06.095.png

This will use GZ compression on each column to make the stored file smaller.

-Jeff

View solution in original post

4 REPLIES 4
Craige_Hales
Super User

Re: Open *.JMP.GZ File (gzip)

What's in the .gz file? a ,CSV? a .JMP?

Can you post a small one here?

 

I think what might be happening: your first open() statement may be launching an external program that expands the gz file, asynchronously. It probably does that in the same location, and removes the trailing .gz extension.

 

I'm not familiar with an external program that behaves that way on Windows, so I'm making a guess. If I'm correct, you could use two JMP functions, LoadTextFile(...blob) and GZIPUncompress to do everything internally and avoid the asynchronous external program. Or, you might be able to use RunProgram to run the external program and wait for it to finish.

 

On Windows, in an explorer window, you can right-click one of the .gz files and see what program Windows uses by default to open it. I'd like to know what program might be doing that for you.

Craige
Jeff_Perkinson
Community Manager Community Manager

Re: Open *.JMP.GZ File (gzip)

If you're using gzip to compress the files outside of JMP you may be taking a step that's not necessary. You can save tables in compressed form using an option in the data table.

 

2020-07-28_18-18-06.095.png

This will use GZ compression on each column to make the stored file smaller.

-Jeff
nmossery
Level II

Re: Open *.JMP.GZ File (gzip)

WOW , I was not aware of this option . 

I will try to add it to my default save file option in my script .

Thanks !

nmossery
Level II

Re: Open *.JMP.GZ File (gzip)

Hi Craig,

I am working on Mac , and gzip is file compression at linux enviorement.

I am working with large .jmp file so I usually compress them in order to save disk space . 

when I re-run my program I open the .gz files manually and then run my scripts . 

I try to add the option to uncompress it from the script .

I manage to uncompress it , but some times the file do not finish uncompress before the next command in the script . 

you are right with your assumption that the open (file.jmp.gz) trigger external program that open the file . 

I wonder if there is an option to know when the open file function finished to uncompress the file . 

Thanks , Noam.