Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > change chr(9) ?

Reply
Thread Tools

change chr(9) ?

 
 
max
Guest
Posts: n/a
 
      02-28-2007
Help

I have txt file with chr(9) in text, how to change chr(9) - horizontal tab
to chr(32)"space"


 
Reply With Quote
 
 
 
 
Ben Morrow
Guest
Posts: n/a
 
      02-28-2007

Quoth "max" <(E-Mail Removed)>:
> Help
>
> I have txt file with chr(9) in text, how to change chr(9) - horizontal tab
> to chr(32)"space"


perl -i~ -pe'tr/\t/ /' txtfile

Ben

--
'Deserve [death]? I daresay he did. Many live that deserve death. And some die
that deserve life. Can you give it to them? Then do not be too eager to deal
out death in judgement. For even the very wise cannot see all ends.'
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      02-28-2007
Abigail wrote:
> max wrote:
> !! I have txt file with chr(9) in text, how to change chr(9) - horizontal tab
> !! to chr(32)"space"
>
> I'd use 'tr'. But that isn't Perl.


Why do you say that 'tr' is not Perl?

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
Reply With Quote
 
Ben Morrow
Guest
Posts: n/a
 
      02-28-2007

Quoth Gunnar Hjalmarsson <(E-Mail Removed)>:
> Abigail wrote:
> > max wrote:
> > !! I have txt file with chr(9) in text, how to change chr(9) - horizontal tab
> > !! to chr(32)"space"
> >
> > I'd use 'tr'. But that isn't Perl.

>
> Why do you say that 'tr' is not Perl?


Because Abigail was referring to the tr(1) Unix utility, which is not
Perl. Perl derives its tr/// operator from the tr(1) utility.

Ben

--
I must not fear. Fear is the mind-killer. I will face my fear and
I will let it pass through me. When the fear is gone there will be
nothing. Only I will remain.
(E-Mail Removed) Frank Herbert, 'Dune'
 
Reply With Quote
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      02-28-2007
Abigail wrote:
> Gunnar Hjalmarsson wrote:
> ][ Abigail wrote:
> ][ > max wrote:
> ][ > !! I have txt file with chr(9) in text, how to change chr(9) - horizontal tab
> ][ > !! to chr(32)"space"
> ][ >
> ][ > I'd use 'tr'. But that isn't Perl.
> ][
> ][ Why do you say that 'tr' is not Perl?
>
> $ which tr
> /usr/bin/tr
> $ which perl
> /opt/perl/bin/perl


Well, since this is a Perl group, the readers had good reasons to assume
that you were referring to the Perl operator tr///.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Democrat's "change," not pocket change Cyberiade.it Anonymous Remailer Computer Support 0 03-14-2009 07:07 AM
"Change your language and you change your thoughts." Suganya C Programming 0 04-29-2008 01:35 PM
Change the master GridView after detail change? Q. John Chen ASP .Net 0 11-15-2006 05:31 PM
Change the master GridView after detail change? Q. John Chen ASP .Net 0 11-15-2006 05:30 PM
A Paradise DNS address change? What change? There was no change. Tony Neville NZ Computing 7 09-22-2006 01:02 PM



Advertisments