Created
November 26, 2019 14:48
-
-
Save nkkarthik/f99417e0727f347844cae1f6e0ba49ab to your computer and use it in GitHub Desktop.
This file contains 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
$outdir = 'splitout' | |
def split file | |
base = File.basename file | |
if File.size(file) < 10000000 | |
puts `cp #{file} #{$outdir}/#{base}` | |
else | |
puts `zcat #{file} | split - -l 1000000 --filter='gzip > $FILE.gz' #{$outdir}/#{base[0..-3]}` | |
end | |
end | |
split ARGV[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment