Tech Blog

Coding, Programming

Split Large Text file into smaller parts

By 42Gears Team1 min read
← Back to blog

Let’s take an example where you need to run a script for a large file of 10 GB, what would the consequences be? Either it will take a lot of time or the program will crash. To avoid such situations we need to divide the text file into smaller parts accordingly.

Let’s get started with how to split a large GB of text file using Git Bash

If you don’t have Git/Git Bash, download at https://git-scm.com/download

To open git bash in the desired location go to the respective location, right click and select gitbash open here as shown below

The command to split the file according to the desired MB is as follows:

split filename.txt -b 150m

The result is as follows

To split the large file according to the lines the command is as follows:

split filename.txt -l 50l

These are two different ways to split a large text file in MB’s or from number of lines using GitBash. It’s simple, easy and quick.

Keep reading

You may be interested in

Browse all articles →
How Angular is Different from AngularJS
September 27, 20227 min read

How Angular is Different from AngularJS

What is Angular? Angular is a popular open-source Typescript framework and free to use. Considered to be a JavaScript-based framework,TypeScript.is its primary programming language. TypeScript is Developed by Microsoft and its superset of JavaScript, which simply means that TypeScript has all the capabilities that JS has and more additional features. Angular is majorly used for […]

By Sachin DevadigaRead More →
Angular constructor vs ngOnInit
September 15, 20223 min read

Angular constructor vs ngOnInit

Overview: If you are new to angular or have been working with it for a while, you will have questions like: Is it necessary to inject dependencies in the constructor and bind data? When should we use ngOnInit ? What is the difference between constructor and OnInit?. So, in this blog we will answer all […]

By Priyanka SRead More →
Variables in CSS
September 12, 20222 min read

Variables in CSS

CSS variables (also referred as CSS custom properties) are just like simple variables in other programming languages. They reduce the redundant work. They are used to storing values and reused at multiple places and updated/modified from one place. Syntax: CSS variable is any CSS property whose name starts with two dashes. Like Custom property names […]

By Irshan AhmedRead More →