Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Replace multiple tabs with spaces at start of a string

by tybalt89 (Monsignor)
on May 16, 2017 at 23:01 UTC ( [id://1190412]=note: print w/replies, xml ) Need Help??


in reply to Replace multiple tabs with spaces at start of a string

#!/usr/bin/perl # http://perlmonks.org/?node_id=1190410 use strict; use warnings; my $input = <<END; | | | | | | | | ! ! first line \t\tsecond line \t\t\tthird line \tfourth line \t\tfifth line \t\tline with\t\tin the middle last line END open my $fh, '<', \$input or die "$! opening file"; while(<$fh>) { s/\G\t/ /g; print; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-25 23:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found