Re: split, no repeat- Regular expression
- From: "Nina" <tin_tint@xxxxxxxxxxx>
- Date: 31 Aug 2005 03:18:56 -0700
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
.
- Follow-Ups:
- Re: split, no repeat- Regular expression
- From: Tad McClellan
- Re: split, no repeat- Regular expression
- References:
- split, no repeat- Regular expression
- From: Nina
- Re: split, no repeat- Regular expression
- From: William James
- split, no repeat- Regular expression
- Prev by Date: Re: split, no repeat- Regular expression
- Next by Date: Re: how to add a space using a regex
- Previous by thread: Re: split, no repeat- Regular expression
- Next by thread: Re: split, no repeat- Regular expression
- Index(es):
Relevant Pages
|
|