
akv003
New User
May 23, 2008, 12:34 PM
Post #1 of 1
(313 views)
|
|
Process Large Single Line Text File size 1 GB
|
Can't Post
|
|
Hi, I need to process 1GB text document with no separator, not even line break, It is single line text document. Here is my program, Line marked in red is not working, can some one help me Here is my program my ($data, $n); while (($n = read FILEHANDLER, $data, 255) != 0) { $_=$data; if (/(\w+)$/) { $_=s/<someSingleWord>/<replacedsingleword>/g; print $_; #If data buffer ends with word, assuming that word may have got split, moving the file handle those character back, this means data buffer will hold characters till some space character seek FILEHANDLER, (tell(FILEHANDLER) - length ($1) ),0 } else{ #..do further processing $_=s/<someSingleWord>/<replacedsingleword>/g; print $_; } }
(This post was edited by akv003 on May 28, 2008, 8:33 AM)
|