Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: formatting text

by jwkrahn (Abbot)
on Jun 20, 2008 at 03:51 UTC ( [id://693053]=note: print w/replies, xml ) Need Help??


in reply to formatting text

Perhaps this will do what you require:

open IN, '<', 'test.txt' or die "Can't open 'test.txt' $!"; open OUT, '>', 'test.out' or die "Can't open 'test.out' $!"; while ( <IN> ) { next unless /\S/; tr/ \t/ /s; print OUT; # Updated -- thanks Narveson } close IN; close OUT;

Replies are listed 'Best First'.
Re^2: formatting text
by Narveson (Chaplain) on Jun 20, 2008 at 04:00 UTC

    Revised I set up test.txt and ran the first version of this code and got no output. Added use warnings and posted the warning messages here with no comment. Sorry if that came across as unfriendly.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-20 09:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found