Re: split, no repeat- Regular expression



I like it!
So quick responce!
Thanks!

& another question:

if I want to replace space with \t for the same file as above, how can
I add \n to the last replaced TAB, what's the problem with this script?

#!usr/bin/perl -w

my $file="dcpd.txt";
open (FILE, "$file") or die "Cannot open file.\n";
@file = <FILE>;
foreach (@file) {s/\s+/\t+/g;}
open (OUT, ">dcpd_tab.txt")or die "Cannot open file.\n";
print OUT @file;
close OUT;
close FILE;

thanks

.



Relevant Pages

  • Re: help me
    ... You might get a responce if you post this in the media newsgroup. ... Mike Pawlak ... Prev by Date: ...
    (microsoft.public.windowsxp.hardware)
  • Re: I CHALLENGE ALL OF YOU
    ... Hmmmm no responce like I figured. ... But at least I didnt get flamed so ... thats progress. ... Prev by Date: ...
    (soc.culture.african.american)
  • Re: But this then sell on Ebay
    ... Not sure I trust a company whose front page advertises a monitor as having ... an "8ms responce time"... ... Prev by Date: ...
    (uk.people.consumers.ebay)
  • Re: Custom exhaust
    ... well, annoying my neighbors is the idea, and nope, not lowering any ... horsepower, thanks for the responce. ... Prev by Date: ...
    (rec.motorcycles)