It is possible to compress and split files using archive tools. However, you can’t individually use the split files without decompressing them to a single file. So, in this article, we will provide different ways with which you can split files while making certain files such as audio, video, text, etc., readable even in split state.
How to Split Files in Windows
Here are the methods you can use to split files in Windows:
Split Files Using a Custom Script
Windows does not have a built-in utility or app to split a file. So, we have created a user-friendly custom PowerShell script for splitting and rejoining a file to help you out. Since most people need to split a file according to a particular size, our custom script implements only this feature. You can use it to create split files with an input MB size. If you want to split using any other sizes, you can change the code as we have directed in the comments (lines followed by #).
To Split the File
First, open Windows PowerShell as admin and enter the command Get-ExecutionPolicy -Scope CurrentUser. You can type powershell on Run and press Ctrl + Shift + Enter to run it as admin. If it shows Restricted, Undefined or AllSigned, you can’t run the script. To change it, enter Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned. If you want more information, please refer to our article on Running Scripts Is Disabled On This System. After changing the execution policy, follow the instructions below: You can also open PowerShell, change the directory to the Split.ps1 file’s location and enter .\Split.ps1 to run it.
To Join the File
First, ensure that PowerShell’s execution policy allows running scripts (see the above section). Then, follow the instructions below to join the files: You can also run the script from PowerShell by entering .\Join.ps1 when on the file’s directory.
Split File Using GNU Utilities for Win32
While Windows doesn’t have a native utility to split and join files, GNU systems like UNIX and Linux systems do. If you have installed git-bash on your computer, you can use the Linux commands- split to divide a file and cat to join them from its CLI. Many developers have created open-source projects to allow some GNU utilities on Windows, such as GNU CoreUtils for Windows. These utilities only rely on Microsoft C-runtime (msvcrt.dll) to run some GNU commands. They also include the split and cat utilities. Here are some necessary information on using these commands:
The complete syntax to divide the file is split [options] file_name [new_files_prefix] where, the bracketed values are optional. You need to replace “file_name” and “new_files_prefix” with the relevant file names.If you enter just split file_name, it will divide the file into sections containing 1000 lines each.If you want to divide the files according to size, you can use the flag -b or –size for [options]. For instance, split -b 10m myfile.txt newfile.To recombine the file, the syntax you need is cat file_part* > file. For instance, you can use cat file1.txt file2.txt file3.txt > merged_file.txt or cat file* > merged_file.We recommend using full paths for the filenames if your current working directory is not the same as the location of the file you wish to split.
You can visit the GNU documentation on CoreUtils to learn more about how you can use these utilities.
Split File Using Third-party Applications
The previous solutions provide limited options for splitting a file on Windows. They also use Command-line Interfaces, so you need to familiar with such interfaces if you want to customize ways to split a file. So most people prefer using third-party tools as it is more convenient and provide more features. Some reliable apps you can use for this purpose are 7-Zip, HJSplit, GSplit, Total Commander, Fastest File Splitter and Joiner, and so on.