How to split and combine files

26

7

How do I split and combine files in Windows?

I need to split large files into several small sized files and then combine them after I transfer them to another box.

I'm fine with doing this on the command line.

David.Chu.ca

Posted 2009-12-07T21:28:44.210

Reputation: 2 967

Answers

9

I tend to compress the required file to a ZIP file, setting a maximum file size so that it gets split.

This means that you will always have the program to get the initial file back available.

Neal

Posted 2009-12-07T21:28:44.210

Reputation: 8 447

@David.Chu.ca Have a look at portable-apps various compressors, like portable-apps 7zip – user400344 – 2017-02-08T00:41:14.397

3Addendum: 7-Zip can zip and split. Look for "Split to volumes, bytes", lower left corner when creating an archive in the GUI. – Nathaniel – 2009-12-07T22:33:30.383

1it can split even without archiving, just like the rest. – None – 2009-12-08T00:37:17.600

I tried this one. Very nice! The size of the package is about 1MG, less than GSplit (1.5MG). I need this tool to transfer files to a remote through a very slow connection. Therefore, the size of app is very important. – David.Chu.ca – 2009-12-09T22:54:50.190

28

If you just want to combine files (which have already been split somewhere else) you can do this in a Windows command prompt natively:

copy /b example.ext.001+example.ext.002+example.ext.003+example.ext.004 example.ext

user190976

Posted 2009-12-07T21:28:44.210

Reputation:

3And it works great out of the box. :) – Achilles – 2014-12-18T21:42:05.680

13

Use HJSplit. It is simply the best.

HJSplit is freeware and portable (300 KB), and it doesn't have to be installed.

There is an older free command-line version of Goetz's File Splitter. You may like this version if you plan on running batch scripts to split lots of files.

7-Zip is another free open source program that allows you split (with or without compression) and combine files, either via GUI (right click on the file → Split File... → choose size) or command line.

If you have Total Commander, it does that as well (Files → Split File...)

Molly7244

Posted 2009-12-07T21:28:44.210

Reputation:

2Seconding Total Commander. – Gepard – 2009-12-07T21:48:29.367

hey, i'm just the messenger but i agree, it hurts the eyes :) other than that it's excellent and easy to use. – None – 2009-12-07T22:26:53.580

Hey! Freebyte... good ol' Freebyte. – Nathaniel – 2009-12-07T22:32:01.417

7

For splitting files to exact sizes, you could always use the Linux / Unix command-line tool split. The Windows version is here: http://unxutils.sourceforge.net/

Using the tool, you can split files to any size you would like, and you would use "cat" to recombine them.

For example:

split -b=10090000 bigfile.iso bigfile_part.

To split your files to exactly 10090000 bytes. Your output would look something like this:

bigfile_part.aa
bigfile_part.ab, etc.

To recombine, just do:

cat bigfile_part* > bigfile.iso

Jon

Posted 2009-12-07T21:28:44.210

Reputation: 91

How do I split a stream. Trying to do this: some_long_running_data_process | split -l 10000 --name the_parts – Justin Thomas – 2015-11-14T14:46:26.493

Please correct: the option is --b, not -b. – mgr326639 – 2016-10-25T12:06:28.680

1Are you sure that cat guarantees that the output is ordered alphabetically? Because if it doesn't, the command will not fail with an error but just produce a different (and wrong) output. – mgr326639 – 2016-10-25T12:08:54.820

3

I've been using this:

type file1 file2 file3 > out

Elmo Todurov

Posted 2009-12-07T21:28:44.210

Reputation: 59

2This only works for text files, and you are not adrressing how the OP can split the large files. – Jan Doggen – 2014-10-28T19:32:12.013

3Did you test it before posting this claim? It actually works well for binary data as well. – Elmo Todurov – 2014-12-03T19:17:26.183

Elmo - your solution worked GREAT! Thanks a ton! I had a multi-part binary that I easily pieced back together using this. – nyxgeek – 2015-10-19T18:19:48.433

1

@nyxgeek well not that great. The correct way to combine binary files on Windows is copy /b like user190976's answer above

– phuclv – 2016-11-11T02:25:01.450

Sure, but I'm not displaying them. See the > out part? It redirects the output into the resulting file. Nothing is typed into the terminal. – Elmo Todurov – 2016-12-04T19:39:39.323

0

In Cygwin (basic install), Bash shell:

dd if=archive.tar bs=512M | xz -e9fc | split -b4000m - /destination/path/archive_split.

Omit the xz pipe block if your archive is already compressed.

To splice your archive together:

cat archive_split.* > archive

user400344

Posted 2009-12-07T21:28:44.210

Reputation: 326

0

You can use WinRAR as a file splitter/joiner as well. To split a file into smaller files, select "Store" as the compression method and enter the desired value (bytes) into "Split to volumes" box. This way you can have split files named as filename.part1.rar, filename.part2.rar, etc.

Mehper C. Palavuzlar

Posted 2009-12-07T21:28:44.210

Reputation: 51 093

0

You might want to use GSplit. It's a powerful and free file splitter that lets you split your large files into a set of smaller files called pieces.

IT_07

Posted 2009-12-07T21:28:44.210

Reputation: 464