From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

File Splitter and Joiner

Code and Documents

Attachment

Summary:

This example demonstrates the use of file splitter.This example shows how to split large ZIP, RAR and 7z archive file into smaller pieces and then join them back again. This is useful when the data to be stored is large for the storage media and the data needs to be split for ease of storage. The example uses binary read/write function to split the files.

Function:

To split ZIP/RAR/7z files into user defined volumes and combine them back to the original file. This is equivalent to other file splitting/joining programs.

Steps to execute code:

For File Splitter VI:

1. Choose the file (ZIP/RAR/7z) you want to split
2. Define the Split Size in kB
3. Run the code
4. The files would be split into files having size defined by Split Size(kB)
     in the root directory of the file
5. Use Joiner.vi to join the files

For File Joiner VI:

1. Enter all the files to be joined in "Files to join" array control
2. Run the VI
3. A pop-up will ask you where and by what name to save the file as. Enter the file
     name along with the extension of the file
4. Click OK to save the joined file
5. Make sure that the file extension is the same as that of the original file which was split
    using File Splitter.vi

Screenshots:

Splitter.jpg

File Joiner.jpg

VI Snippet:

File Splitter :

File_Splitter.png

File Joiner:

File Joiner.png

VI attached below

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
MrPSC
Member
Member
on

this is really helpful while handling large files

surfnska
Member
Member
on

Nice but when creating multiple files the sort used to stitch them together sorts like this 0, 1, 10, 11, 2, 3... Using OpenG code I added a 1 sec delay after creating each smaller file in the splitter vi, then replaced the sort array function in the joiner vi with a sub vi which I cannot show a screen shot of for some reason.

FraggerFox
Active Participant Active Participant
Active Participant
on

Thanks for the comment....fix has been uploaded now!

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
FraggerFox
Active Participant Active Participant
Active Participant
on

MrPSC, thanks for your comment!

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
Contributors