Created
May 20, 2016 00:47
-
-
Save thekad/db7e723f561c2ed66cffadd7b2ea5093 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
#!/usr/bin/perl | |
use PerlIO::gzip; | |
$filename = 'YOUR_FILENAME.gz'; | |
$limit = 1000000; | |
$fileno = 1; | |
$line = 0; | |
while (<>) { | |
if (!$fh || $line >= $limit) { | |
open $fh, '>:lzop', "$filename_$fileno.lzo"; | |
$fileno++; | |
$line = 0; | |
} | |
print $fh $_; $line++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment