Hi,
I need to process 1 GB large text document which has no line break or separating character (i.e. all file content is in single line).
I tried using perl read buffer command but it breaks the last word, which I do not want to break because I am doing some addition processing for word replacement.
Here is my program
my ($data, $n);
while (($n = read FILEHANDLER, $data, 255) != 0) {
if (/(\w+)$/)
{
seek FILEHANDLER, (tell(FILEHANDLER) - length ($1) ),0
}
..do further processing
}
Can someone help me to write this program in perl
I need to process 1 GB large text document which has no line break or separating character (i.e. all file content is in single line).
I tried using perl read buffer command but it breaks the last word, which I do not want to break because I am doing some addition processing for word replacement.
Here is my program
my ($data, $n);
while (($n = read FILEHANDLER, $data, 255) != 0) {
if (/(\w+)$/)
{
seek FILEHANDLER, (tell(FILEHANDLER) - length ($1) ),0
}
..do further processing
}
Can someone help me to write this program in perl