Last active
January 5, 2019 11:40
-
-
Save itoche/3985c51e8ae23a49d072f325eb7672d2 to your computer and use it in GitHub Desktop.
Split each TXT file contained in a directory into chunks of a maximum size (here 5k)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
directory=INSERT INPUT DIRECTORY HERE | |
output=INSERT OUTPOUT DIRECTORY HERE | |
mkdir $output | |
find $directory -type f -name '*.txt' -exec basename {} \; | while read file; | |
do | |
split -b 5k "$directory"/"$file" "$output"/"$file". | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment