Created
March 31, 2013 01:23
-
-
Save dmiedema/5279092 to your computer and use it in GitHub Desktop.
PHP fixed size file parser. Designed to take a huge file and break it down into a bunch of smaller ones
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
<?php | |
$file = fopen($argv[1], "r"); | |
$output = $argv[2]; | |
$count= 0; | |
if ($file) { | |
while(!feof($file)) { | |
$buffer = fgets($file, 10240); | |
$newFile = fopen($output . $count, "w"); | |
fwrite($newFile, $buffer); | |
$count++; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment