Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: Windows 7 Remove Tabs Out of Memory

by Rudolf (Pilgrim)
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/ /;

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


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://984651]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2018-06-18 00:11 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (107 votes). Check out past polls.