CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
Process Large Single Line Text File size 1 GB


New User

May 23, 2008, 12:34 PM

Post #1 of 1 (799 views)
Process Large Single Line Text File size 1 GB Can't Post


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) {

if (/(\w+)$/)

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{ further processing


print $_;


(This post was edited by akv003 on May 28, 2008, 8:33 AM)


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives