Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: How do I replace \t and regarding to the alignment requirement ?

by PerlOnTheWay (Scribe)
on Apr 19, 2012 at 13:49 UTC ( #965960=note: print w/replies, xml ) Need Help??


in reply to Re: How do I replace \t and regarding to the alignment requirement ?
in thread How do I replace \t and regarding to the alignment requirement ?

expand blindly replaces 1 tab with 8 spaces,so it's not fit for this task...
  • Comment on Re^2: How do I replace \t and regarding to the alignment requirement ?
  • Download Code

Replies are listed 'Best First'.
Re^3: How do I replace \t and regarding to the alignment requirement ?
by Corion (Pope) on Apr 19, 2012 at 13:55 UTC

    Weird - at least this version of expand works for me, and the source code suggests that it should work just as it does:

    Q:\>copy con test.txt blah a blah ^Z 1 file(s) copied. Q:\>perl -w expand.pl test.txt blah a blah Q:\>perl -w expand.pl test.txt|perl -ple "s!\t!x!g" blah a blah Q:\>perl -w expand.pl test.txt|perl -ple "s! !_!g" blah____a_______blah Q:\>type test.txt|perl -ple "s! !_!g" blah a blah

    If expand is not working for you, maybe the code I linked to does work for you and you can reuse that?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2016-10-01 21:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?






    Results (8 votes). Check out past polls.