# How To Split Large Text File In Windows

**URL:** <https://onehack.st/t/how-to-split-large-text-file-in-windows/218539>\
**Category:** Tutorials & Methods\
**Tags:** tips-tricks, file-management\
**Created:** [April 11, 2022, 12:48am UTC](https://onehack.st/t/how-to-split-large-text-file-in-windows/218539 "2022-04-11T00:48:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prometheus](https://onehack.st/user_avatar/onehack.st/prometheus/32/34950_2.png) [@Prometheus](https://onehack.st/u/Prometheus)\
**Post date:** [April 11, 2022, 12:48am UTC](https://onehack.st/t/how-to-split-large-text-file-in-windows/218539/1 "2022-04-11T00:48:41Z")

</div>

**Example:** If you have a log file with a size of 2.5 GB. and you’re willing to split this file into smaller files using the Windows command prompt? then follow the method:

If you have installed [Git for Windows](https://git-scm.com/download), you should have Git Bash installed, since that comes with Git.

Use the **`split`** command in Git Bash to split a file:

- into files of size 500MB each: **`split myLargeFile.txt -b 500m`**
- into files with 10000 lines each: **`split myLargeFile.txt -l 10000`**

**Tips:**

- If you don’t have Git/Git Bash, download at [https://git-scm.com/download](https://git-scm.com/download)
- If you lost the shortcut to Git Bash, you can run it using **`C:\Program Files\Git\git-bash.exe`**

# That’s it!

I always like examples though…

**Example** :

 ![image](https://onehack.st/uploads/default/original/3X/7/2/725275affe0dd2bfc369c42d242c34046c55c51a.png)

You can see in this image that the files generated by **`split`** are named `xaa`, `xab`, `xac`, etc.

These names are made up of a prefix and a suffix, which you can specify. Since I didn’t specify what I want the prefix or suffix to look like, the prefix defaulted to `x`, and the suffix defaulted to a two-character alphabetical enumeration.

**Another Example:**

This example demonstrates

- using a filename prefix of `MySlice` (instead of the default `x`),
- the `-d` flag for using numerical suffixes (instead of `aa`, `ab`, `ac`, etc…),
- and the option `-a 5` to tell it I want the suffixes to be 5 digits long:

 ![image](https://onehack.st/uploads/default/original/3X/8/b/8b8bb85de01839dee449b1a5f013c76ccc734329.png)

**Happy learning!**

---

<div class="post-metadata">

**Author:** ![me\_the\_bug](https://onehack.st/user_avatar/onehack.st/me_the_bug/32/43838_2.png) [@me\_the\_bug](https://onehack.st/u/me_the_bug)\
**Post date:** [April 11, 2022, 6:20am UTC](https://onehack.st/t/how-to-split-large-text-file-in-windows/218539/2 "2022-04-11T06:20:43Z")

</div>

For less tech savy

 ![image](https://onehack.st/uploads/default/original/3X/d/9/d9b96054950f8e74b91d3b0eb85bcbde95dfa434.png)  
[https://www.microsoft.com/store/productId/9PFNL897RKKM](https://www.microsoft.com/store/productId/9PFNL897RKKM)
