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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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

 



akv003
New User

May 23, 2008, 12:34 PM

Post #1 of 1 (379 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)

 
 


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

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