I know the question has been asked a long time ago, but I am surprised that nobody has given the most straightforward unix answer:
split -l 5000 -d --additional-suffix=.txt $FileName file
-l 5000
: split file into files of 5,000 lines each.-d
: numerical suffix. This will make the suffix go from 00 to 99 by default instead of aa to zz.--additional-suffix
: lets you specify the suffix, here the extension$FileName
: name of the file to be split.file
: prefix to add to the resulting files.
As always, check out man split
for more details.
For Mac, the default version of split
is apparently dumbed down. You can install the GNU version using the following command. (see this question for more GNU utils)
brew install coreutils
and then you can run the above command by replacing split
with gsplit
. Check out man gsplit
for details.
Related Posts:
- What does %~dp0 mean, and how does it work?
- What does %~dp0 mean, and how does it work?
- Rainbow Matrix CMD
- How to capture cURL output to a file?
- Color echo in batch files
- How Should I Set Default Python Version In Windows?
- How can I pass arguments to a batch file?
- What is the current directory in a batch file?
- Batch file to copy directories recursively
- How to change current working directory using a batch file
- Cygwin Make bash command not found
- Invalid drive specification using XCOPY
- Command Prompt Error ‘C:\Program’ is not recognized as an internal or external command, operable program or batch file
- Batch file to copy files from one folder to another folder
- How do I execute cmd commands through a batch file?
- wget not recognized as internal or external command
- How to fix “ERROR: The system was unable to find the specified registry key or value.” when running a batch file
- How does strtok() split the string into tokens in C?
- How to execute a program or call a system command?
- Javascript split regex question
- What does “@” mean in Windows batch scripts
- Java split string to array [duplicate]
- How can I split and parse a string in Python?
- Split string into array
- Parse (split) a string in C++ using string delimiter (standard C++)
- Split a string using C++11
- string to string array conversion in java
- ” is not recognized as an internal or external command, operable program or batch file
- How to split a String by space
- Split string with multiple delimiters in Python [duplicate]
- ‘\r’: command not found – .bashrc / .bash_profile [duplicate]
- How do you split a string in Python with multiple delimiters?
- ‘adb’ is not recognized as an internal or external command, operable program or batch file
- Create an empty file on the commandline in windows (like the linux touch command)
- How to split a delimited string into an array in awk?
- How to split a string into an array in Bash?
- make: g++: Command not found
- How do I create a Batch file to change an exe installer to Win XP SP3 compatibility mode and launch installer
- ” is not recognized as an internal or external command, operable program or batch file
- Difference between xcopy and robocopy
- How to split a string in Java
- Meaning of exit status 1 returned by linux command
- How do I split a string on a delimiter in Bash?
- Bat file to run a .exe at the command prompt
- Batch script loop
- What is the difference between Cygwin and MinGW?
- Cygwin – Makefile-error: recipe for target `main.o’ failed
- The program can’t start because cygwin1.dll is missing… in Eclipse CDT
- How do you split a list into evenly sized chunks?
- How to split a string into a list of characters in Python?
- What is causing the error `string.split is not a function`?
- how to uninstall MinGW and make cygwin ‘make’ as deafult make program with gcc 3.8.1
- What is causing the error `string.split is not a function`?
- Equivalent of *Nix ‘which’ command in PowerShell?
- sudo command not found on Cygwin
- How to get line count of a large file cheaply in Python?
- xcopy returns error “Invalid number of parameters” when exclude parameter is set
- Pandas split DataFrame by column value
- While loop in batch
- How do I ignore files in Subversion?
- Curl not recognized as an internal or external command, operable program or batch file
- Python read in string from file and split it into values
- Split function add: \xef\xbb\xbf…\n to my list
- C++ Not Installed In Cygwin
- Redirecting Output from within Batch file
- Run Command Prompt Commands
- Float must be a string or a number?
- apt-get for Cygwin?
- False ‘Sharing Violation’ Xcopy error message
- How does the echo command works in batch programming
- How to install and run the Nmap program through Cygwin in Windows?
- How to split elements of a list?
- Need auto-restart script in batch for minecraft server
- How to use random in BATCH script?
- “-bash: gcc: command not found” using cygwin when compiling c?
- Invalid write of size 1
- Split string into array of character strings
- Windows batch – concatenate multiple text files into one
- What is the difference between the remap, noremap, nnoremap and vnoremap mapping commands in Vim?
- Git push hangs when pushing to Github?
- Best practice for exiting batch file?
- “Permission Denied” using cygwin in Windows
- Creating Unique Post URLs for A/B Testing… Is this even possible?
- How i can i add a split button or list box to the WordPress TinyMCE instance
- Split content into multiple columns using more tag?
- Divide Post content into separate divs for every 500 characters (or any other character counts)
- Split a database will improve performance?
- How can I create a Bible search engine via WordPress? [closed]
- Split function “the_tags” in 2 columns
- with PHP within splits the link
- Available methods for a/b testing the content
- How to split the WordPress database?
- Retrieve posts inside foundation tabs and tab-content split by 3 per row
- Segregating content in a blog for 2 different readers
- Change single.php template based on parent category
- inserting every 200 characters automatically
- Programmatically Split A Post Into Multiple Pages
- Custom fields: Split data from single custom field’s sub-array to separate custom fields when saving post
- Is there a global, persistent CMD history?