Last active
October 20, 2019 06:54
-
-
Save gamba/9fb163d3ce32c835c8a8afd7a3798906 to your computer and use it in GitHub Desktop.
Split large mbox file with awk
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
BEGIN{chunk=0} | |
/^From /{ | |
msgs++;if(msgs==1000){ | |
close(("chunk_" chunk ".mbox")i); | |
msgs=0;chunk++ | |
} | |
} | |
{print > ("chunk_" chunk ".mbox")} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
awk -f split_mbox.awk <mbox_file>