31

How can we split file in windows system in command prompt based on size. like linux system we use

"split -b 10M filename.xyz new_filename"
Ganesh
  • 837
  • 1
  • 11
  • 18
  • actually i want to use split command in windows command prompt for split file. I was use "gfsplit filename.xyz 1440" but not working. :( – Ganesh Jan 05 '16 at 12:44
  • What is the error? Why isn't it working? – Idos Jan 05 '16 at 12:49
  • it working fine, sorry i missing the syntax this is correct one "gfsplit filename.xyz new_filename 10240". Thanks – Ganesh Jan 05 '16 at 12:58
  • 2
    Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Sep 03 '18 at 10:45

3 Answers3

37

If you have "git bash" use the linux split, if don't have it, download it from: https://git-scm.com/

I hope it works for you

Juan Uribe
  • 573
  • 4
  • 5
29

You can compress the required file to a zip (or rar) 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.
Some options are:

  • HJSplit is a freeware and portable (size == 300 KB), and doesn't have to be installed.
  • There is an older, free command-line version of Goetz's File Splitter, it is best if you plan on running batch scripts to split many files.
  • 7-Zip is another free open source program that allows you to split (with or without compression) and combine files, either via GUI (right click on the file > Split File... > choose size) or command line.
  • Total Commander does that as well (Files > Split File...).
Idos
  • 15,053
  • 14
  • 60
  • 75
  • You can alternatively use [GSplit](https://www.gdgsoft.com/gsplit). I found the utility incredibly helpful when I have to move large files to a hard disk that has a FAT32 file system. This program also creates an executable which can unite all the files after splitting them in the destination directory, which is very helpful. – Avneesh Mishra Jun 14 '20 at 20:11
  • The link to HJSplit has rotted and looks to be a spam farm now. Is there a new official home or is the project dead? (A cursory search for it turns up lots of reviews and alternative download sites, but nothing that looks like an official page.) – SJML Nov 26 '21 at 07:58
0

Split a file with a max specified size.

  • Suppose we want to split a 500mb file. We want to split it with max size 50mb. So this code will split the file with max 50mb size. 500mb file will be splitted into 10 file with 50mb size.
split mcg_games_log.sql -b 50M mcg_games_log_ --additional-suffix=".sql" --numeric-suffixes