Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

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]
[karlgoethebier]: shmem: something went wrong today?
[shmem]: karlgoethebier: of course
[shmem]: has there been any single day where nothing went wrong? not in my memory
[shmem]: discovered a fuel tank leakage at my second hand motorbike. Some bloke drove a screw too long through the fairing
[shmem]: hard to fix, and plans wrecked. And more... won't tell.
[shmem]: the leakage has been "fixed" with a piece of bycicle tube. Bleargh.

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2017-06-25 19:56 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (569 votes). Check out past polls.