Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: is this correct

by Gloom (Monk)
on Feb 03, 2001 at 00:10 UTC ( #56085=note: print w/replies, xml ) Need Help??


in reply to is this correct

What's append if the file take 150mb of disk space ?

Maybe you may use something like this :

# perl -e 'while(<>){s/\t/ /g;print}' < file > file.tmp;\ > mv file.tmp file;

Update : Thank's arhuman for this comment. This option is really usefull.

Hope this helps

Replies are listed 'Best First'.
Re: Re: is this correct
by arhuman (Vicar) on Feb 03, 2001 at 00:15 UTC
    In case like this (a while loop around one or more files) the perl -ne is usually a good candidate...

    Something like :
    perl -ne 's/\t/ /g;print' file > file.tmp; mv file.tmp file;
      To abstract it a little more

      perl -i.back -pe 's/\t/    /g' file

      The -i means copy original file to file.back and put the output of program in file. The -p is like -n but does while(<>){YOUR_CODE; print;} instead.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2022-01-24 15:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (64 votes). Check out past polls.

    Notices?