LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

creating zip file

Solved!
Go to solution

i am creating a text file with a specific name and several values from an experiment. I need to place this text file in a zip file that also has a specific name referring to the respective experiment. I am not sure how to go about doing this. I read something about creating projects, but that seemed more manual. I need this to be automatic so that when the values are obtained, it creates the zip file and then creates and puts the txt file in the zip file. Thanks in advance.

0 Kudos
Message 1 of 3
(3,033 Views)
Solution
Accepted by topic author lvuser333

@lvuser333 wrote:

i am creating a text file with a specific name and several values from an experiment. I need to place this text file in a zip file that also has a specific name referring to the respective experiment. I am not sure how to go about doing this. I read something about creating projects, but that seemed more manual. I need this to be automatic so that when the values are obtained, it creates the zip file and then creates and puts the txt file in the zip file. Thanks in advance.


Try something like this

zipitup_BD.png

Essentially it uses the experiment name to generate a full path for a text file, and a full path for a zip file (both with the common experiment name) in the location based on the file path.

It then writes the results to a text file, creates/opens a zip file, adds the newly created text file to the zip and closes it.

0 Kudos
Message 2 of 3
(3,020 Views)

I should also point out that it has no checking for valid file locations, and doesn't check to see if you're overwriting a previous file.

By creates/opens I mean it creates it and then opens it for writing. This will not work with existing zip files.

0 Kudos
Message 3 of 3
(3,011 Views)