Inspired from GitHub article:
-
How can I split a text file using PowerShell?
https://stackoverflow.com/questions/1001776/how-can-i-split-a-text-file-using-powershell
... and the answer from Typhlosaurus (https://stackoverflow.com/users/311372/typhlosaurus)
http://stackoverflow.com/a/11010158/215200
... and awayken (https://stackoverflow.com/users/215200/awayken) who posted the following GitHub gist:
-
awayken/Split-File.ps1
https://gist.github.com/awayken/5861923
I wrote this because I needed to split large base64 text files.
This PowerShell script was created and tested with version 5.1 on Windows 10.
If/when/maybe I have time I will test on other platforms such as Ubuntu.
These examples asume the above PowerShell session.
The script will assume an output file size of 1 MiB.
.\split_text_file_PowerShell5\Split_file_v2.ps1 -inFile myTestFile.b64
This example specifies that the output file size should be 2 MiB instead of the default 1 MiB.
.\split_text_file_PowerShell5\Split_file_v2.ps1 -inFile myTestFile.b64 -outputFileSize 2MB
.\split_text_file_PowerShell5\Split_file_v2.ps1 -inFile myTestFile.b64 -outFile fooFile.b64
This will have to wait until I create the corresponding script to put these split files back together.
Andrew Nagy