Big File Needs Broken

Vegito

Diamond Member
Oct 16, 1999
8,329
0
0
I have a 754Megabyte log file that I need to decipher.. or broken to a max of 32megabyte.. I try a file breaker and did not have success.. anyone here tried something like that.
 

defiant

Junior Member
Sep 28, 2000
12
0
0
Here is some C++ code that can do this:

#define max_file_size 102400

char buffer[max_file_size];
long file_size, len1, len2;
int num_blocks;
int file_in, file_out;

file_in = _open(input_file, _O_BINARY | _O_RDONLY);

file_size = filelength(file_in);
num_blocks = (int)(file_size / 102400);
char number[100] = "\0";
for (int j=0; j<num_blocks; j++)
{
_itoa(i, number, 10);
strcat(output_file, number);
file_out = _open(output_file, _O_BINARY | _O_WRONLY | _O_CREAT);

for (int i = 0; i< 35; i++)
{
len1 = _read(file_in, buffer, max_file_size);
len2 = _write(file_out, buffer, max_file_size);
}
_close(file_out);
}
_close(file_in);

Keep in mind function does no error handling. Its something I put together for breaking long mp3 files. let me know if you have questions.

BTW. you will need to include io.h in the driver program. It generates 35 mb files from a larger file named output_file1, output_file2 etc...
 

Zaphs

Senior member
Oct 9, 1999
302
0
0
I agree with VanderStoep

You can pick winrar up HERE

The program is a compression program that allows you to break up the program or file you're compressing into files that will fit on one disk (Or any user defined size, such as 32MBs). Then it re-assembles them when you need them.

Hope this helps!
 

Vegito

Diamond Member
Oct 16, 1999
8,329
0
0
sorry I didn't clarify, I need it break it uncompress so I can read it.. its a text file so like after hitting x lines or x size, it make a new file. Will try.. thank.