This is a guide on How to Split a text file in half (or any percentage) on Ubuntu Linux If you have an unwieldy text file that you are trying to process, splitting it in sections can sometimes help processing time, especially if we were going to import a file into a spreadsheet. Or you might want to just retrieve a particular set of lines from a file.
Enter split, wc, tail, cat, and grep. (don’t forget sed and awk). Linux contains a rich set of utilities for working with text files on the command line. For our task today we will use split and wc. Split a text file in half
We’ve now split our text files into 3 seperate files, each containing less than 60000 lines, which seemed like a good number to choose. The last file contains the leftover amount. If you were going to cut this particular file in half, you’d have done this:
Am a Kenyan Based Politician, Senior blogger, Digital Communications expert, YouTuber, Pan Africanist, columnist, Human Rights Activist, informer & businessman. Contact me on +254791890826 or Email Me on email@example.com