Skip to content

Instantly share code, notes, and snippets.

@thekad
Created May 20, 2016 00:47
Show Gist options
  • Save thekad/db7e723f561c2ed66cffadd7b2ea5093 to your computer and use it in GitHub Desktop.
Save thekad/db7e723f561c2ed66cffadd7b2ea5093 to your computer and use it in GitHub Desktop.
#!/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