Compression Utility Request

Have a suggestion for improving DPlot or a question about existing features? Let us know

Moderator: DPlotAdmin

Post Reply
jsc
Posts: 222
Joined: Fri Dec 02, 2005 8:56 am

Compression Utility Request

Post by jsc »

David,

Any chance of providing a small utility or functionality to compress grf files to grfz in batch mode? Would come in handy.

Might like option to keep file dates same as the file converted, and an option to blow away the original uncompressed file after conversion.

Recursing subdirectories might also be nice, but not as necessary.

Doesn't have to be pretty. A standalone command line version would do well enough. Maybe could work within a DPlot "convert" or "save as" dialog.

Thanks.

Jon
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Jon,
Good idea for when I have some breathing room, thanks. In the meantime, I assume you know you can already do the conversion with a macro:

ForFilesIn("*.grf")
FileSaveAs(15,".grfz")
FileClose()
NextFile


This won't preserve file dates (actually I think that might be an insurmountable problem on Vista, not sure) or delete the originals, but it will perform the primary task that you're interested in.
Visualize Your Data
support@dplot.com
jsc
Posts: 222
Joined: Fri Dec 02, 2005 8:56 am

Post by jsc »

I think you posted that macro before - I should have known! :oops:

Will go that way for now.

And Happy New Year! (I hope!!!!)
jsc
Posts: 222
Joined: Fri Dec 02, 2005 8:56 am

Post by jsc »

"Illegal file type code in FileSaveAs() command." using FileSaveAs(15,".grfz") exactly as you have it. (I did add a "Directory()" command to put DPlot into the correct directory as a first command.)

Also, the way I'm reading the help file, I'm thinking that there is no easy way to save the file with the same file name if the file name is not the same as the plot title. I tried:

FileSaveAs(15,"|FILENAME|.grfz")

and I get an "Unrecognized replaceable parameter |FILENAME|" error, but this time no "Illegal file type" message.

This was with one of the plots showing in DPlot.

When I closed all open plots and then tried to run the macro, nothing happened (that I could see!).

Any ideas?

Thanks.
Last edited by jsc on Tue Jan 06, 2009 10:39 pm, edited 1 time in total.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

D'oh!

The "Illegal file type" error message is generated by the macro editor, which hasn't kept up with dplot.exe. Sorry for the trouble. This is fixed. I'll most likely be posting an update tomorrow (1/7) after cleaning up a few other odd problems.

|FILENAME| doesn't work in a loop - I'll probably add that sooner or later, but if you simply want to use the same filename there's no need for this; just use (after tomorrow)

FileSaveAs(15,".grfz")

or

FileSaveAs(15,"")

In either case the path and filename will be the same. For the latter case, the default extension .grfz for that type will be used.
Visualize Your Data
support@dplot.com
jsc
Posts: 222
Joined: Fri Dec 02, 2005 8:56 am

Post by jsc »

Will watch for update. Thanks as always!

Jon
Post Reply