Use 7 zip from system.util.execute

Is it possible to use 7 zip from the system.util.execute function? I have been trying, but cannot seem to figure out what parameters need to be sent in the list. I can do it from the windows command window just fine.

system.util.execute([“C:\\Program Files\\7-Zip\\7z.exe”,“e c:\\gzTest\\zippedFile.gz -so > c:\\gzTest\\unzippedFile.csv -aoa”])

Try each space-delimited option as a separate element in the list:
system.util.execute(["C:/Program Files/7-Zip/7z.exe", "e", "C:/gzTest/zippedFile.gz", "-so", ">", "C:/gzTest/unzippedFile.csv", "-aoa"])

Also, I’m pretty sure you can just use forward-slashes and not have to worry about Windows paths, although system.util.execute may be an exception to that.

That did not seem to work either. What I was able to get to work was to make a bat script and then call the bat script from system.util.execute.

1 Like

Java has built-in zip and gzip support–no need to launch an external process.

I was using gzip but it was to memory and cpu intensive for the big files I am working with. It would cause the gateway to slow down and disconnect. Using the operating system seems much faster.