Re: extract info from file name

2002-07-08 Thread Janek Schleicher
Kevin Pfeiffer wrote at Sun, 07 Jul 2002 22:34:36 +0200: > What is the difference between "if ( $test =~ m/...)" and "if ( $test =~ /...)" ^/^ ^/^ > (without the "m")? > (If any?) For Perl there's no difference, but some

Re: extract info from file name

2002-07-07 Thread Jenda Krynicky
From: Kevin Pfeiffer <[EMAIL PROTECTED]> > > my $test = "Rnott230602.txt"; > > if ( $test =~ m/^(.{1})(.{4})(.{6})\.(.{3})$/ ) { > > What is the difference between "if ( $test =~ m/...)" > and "if ( $test =~ /...)" (without the "m")? (If any?) None. The "m" just allows you to use a different d

Re: extract info from file name

2002-07-07 Thread Kevin Pfeiffer
Hi from an (until now) silent list reader, Nigel Peck writes: > I probably should have explained what this is doing, the match m// takes > the string in $test and (using the parenthesis for capturing), puts the > first character in $1, the second 4 characters in $2... [...] Such explanations are

Re: extract info from file name

2002-07-02 Thread Janek Schleicher
John W. Krahn wrote at Tue, 02 Jul 2002 22:51:17 +0200: > filenameRnott230602.txt > > I want to break down the name and compare with other text, it breaks down > as R / nott / 230602 (3 items) > the length does not change. > If the length is always the same you could use unpack. > > my ( $t

Re: extract info from file name

2002-07-02 Thread John W. Krahn
Steven Massey wrote: > > Hi Hello, > filenameRnott230602.txt > > I want to break down the name and compare with other text, it breaks down > as R / nott / 230602 (3 items) > the length does not change. > > Now I know I can split() each char and combine into a string > > Is there a smarte

Re: extract info from file name

2002-07-02 Thread Sudarsan Raghavan
[EMAIL PROTECTED] wrote: > Hi > > filenameRnott230602.txt > > I want to break down the name and compare with other text, it breaks down > as R / nott / 230602 (3 items) > the length does not change. If this is an equality compare, why don't you concatenate the other texts and compare the res

Re: extract info from file name

2002-07-02 Thread Steven_Massey
Nigel and Connie.. Thanks a lot - much neater than I was doing Steve -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: extract info from file name

2002-07-02 Thread Nigel Peck
I probably should have explained what this is doing, the match m// takes the string in $test and (using the parenthesis for capturing), puts the first character in $1, the second 4 characters in $2, the third 6 characters in $3, skips the dot and puts the last 3 characters in $4. This relies on th

Re: extract info from file name

2002-07-02 Thread Connie Chan
esday, July 02, 2002 4:04 PM Subject: Re: extract info from file name > So what exactly you want ? how about > my @result = ($1, $2, $3) if ( $filename =~ /^(w{1})(w{4})(d{6})\.txt/ ) > > Is that what you want ? > Smiley Connie =) > > > - Original Message - > Fro

Re: extract info from file name

2002-07-02 Thread Connie Chan
So what exactly you want ? how about my @result = ($1, $2, $3) if ( $filename =~ /^(w{1})(w{4})(d{6})\.txt/ ) Is that what you want ? Smiley Connie =) - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 02, 2002 3:23 PM Subject: extract info fro

Re: extract info from file name

2002-07-02 Thread Nigel Peck
my $test = "Rnott230602.txt"; $test =~ m/^(.{1})(.{4})(.{6})\.(.{3})$/; my $first_part = $1; my $second_part = $2; my $third_part = $3; my $extension = $4; >>> <[EMAIL PROTECTED]> 07/02/02 08:23am >>> Hi filenameRnott230602.txt I want to break down the name and compare with other text, it b