Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Windows 7 Remove Tabs Out of Memory

by Rudolf (Monk)
on Jul 31, 2012 at 19:33 UTC ( #984651=note: print w/ replies, xml ) Need Help??


in reply to Windows 7 Remove Tabs Out of Memory

Tim, I suggest looping through the file yourself in any case, its fairly simple: and using tr/// instead of s/// is an improvement.

open(OLD,'<','large_file.txt') or die "$!";#open old file my @old_file_contents = <OLD>; close(OLD); open(NEW,'>','test.txt') or die "$!";#open new file foreach my $line(@old_file_contents){ $line =~ tr/\t//d; #delete tabs print NEW $line; #print line to new file } close(NEW);

UPDATE: I see your replacing them with a space, so maybe just try

$s =~ tr/\t/ /;


Comment on Re: Windows 7 Remove Tabs Out of Memory
Select or Download Code
Replies are listed 'Best First'.
Re^2: Windows 7 Remove Tabs Out of Memory
by tallums (Initiate) on Jul 31, 2012 at 19:59 UTC

    Thanks Rudolf! Thanks everybody!

    Rudolf's suggestion works for me :)

    Tim

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://984651]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2015-07-08 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (94 votes), past polls