Re: spaces in file name

2009-06-18 Thread Chas. Owens
On Thu, Jun 18, 2009 at 03:14, Irfan Sayed wrote: > Hi All, > > I am stuck on parsing file name if it has space. > I have file name as : file system.proj > now this file contains space between worf file and system > > now i want to do ceratin operation on this file > but whenever i give this file n

Re: spaces in file name

2009-06-18 Thread Steve Bertrand
Irfan Sayed wrote: > Hi All, > > I am stuck on parsing file name if it has space. > I have file name as : file system.proj > now this file contains space between worf file and system > > now i want to do ceratin operation on this file > but whenever i give this file name in any command then it

Re: spaces in filenames on winXX

2005-02-21 Thread Jean-Sébastien Guay
Harry, You have three choices. [...] snipped techniques So back to my original question: Is there a module or something that takes care of that pre processing for me? I think you misunderstood. The problem with your script is not the spaces in the string. It's that you used a single b

RE: spaces in filenames on winXX

2005-02-21 Thread Charles K. Clarkson
Harry Putnam <> wrote: : So back to my original question: : Is there a module or something that takes care of that pre : processing for me? There is no pre-processing. I use this same idiom on either platform. What do you mean by pre-processing? my $file = 'foo/bar/baz/no pre-processing

Re: spaces in filenames on winXX

2005-02-21 Thread Harry Putnam
"Charles K. Clarkson" <[EMAIL PROTECTED]> writes: [...] > You have three choices. [...] snipped techniques So back to my original question: Is there a module or something that takes care of that pre processing for me? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands

RE: spaces in filenames on winXX

2005-02-20 Thread Charles K. Clarkson
Harry Putnam <> wrote: : Here is an example of problems before even getting to spaces. : Doesn't this mean that some kind of preprocessing must take : place? : : #!C:\Perl\bin -w Shame! Always use strictures (except when mumble, mumble, mumble). use strict; : ## This is the format that

Re: spaces in filenames on winXX

2005-02-20 Thread Harry Putnam
"Jenda Krynicky" <[EMAIL PROTECTED]> writes: > Try to write the script you need and come back if you run into > problems. This isn't in keeping with Johns point about using opendir/readdir but I'm not sure I followed that anyway. Here is an example of problems before even getting to spaces. Do

Re: spaces in filenames on winXX

2005-02-20 Thread Jenda Krynicky
From: Harry Putnam <[EMAIL PROTECTED]> > Scripting in perl on a Windows OS and spaces in file names. > > I'm pretty sure this has been covered many times here, and I believe > there are modules and such devoted to the problem but searching on >www.cpan.org > with various search strings hasn't

Re: spaces in filenames on winXX

2005-02-20 Thread John W. Krahn
Harry Putnam wrote: Scripting in perl on a Windows OS and spaces in file names. I'm pretty sure this has been covered many times here, and I believe there are modules and such devoted to the problem but searching on www.cpan.org with various search strings hasn't turned up something specificall

RE: spaces in a variable

2002-10-08 Thread Toby Stuart
> -Original Message- > From: Javeed SAR [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, October 09, 2002 5:05 PM > To: [EMAIL PROTECTED] > Subject: spaces in a variable > > > Hi, > > How to remove spaces in a variable? > For eg if i have variable $te > > $te = $attr_tag . $date; > cho

Re: Spaces...

2002-06-10 Thread drieux
On Monday, June 10, 2002, at 10:02 , Fontenot, Paul wrote: > I have a logfile that has the following format: > > month day time > > The problem is splitting on the "space" - split(/ /). Sometimes there are > more than one space. How can I get perl to split on 1 or more spaces? call me old fash

Re: Spaces...

2002-06-10 Thread Bryan R Harris
Or, as Jonathan (?) pointed out to me not too long ago, there is a special case of split that wipes leading whitespace before splitting on /\s+/: split(' ', $line); Enjoy. - B __ Hi Paul, Just use : ($month, $day, $time) = (split /\s+/, $line); the /s+ stands for 1 or mo

RE: Spaces...

2002-06-10 Thread Bob Showalter
> -Original Message- > From: Fontenot, Paul [mailto:[EMAIL PROTECTED]] > Sent: Monday, June 10, 2002 1:02 PM > To: Perl - Beginners (E-mail) > Subject: Spaces... > > > I have a logfile that has the following format: > > month day time > > The problem is splitting on the "space" - split

RE: Spaces...

2002-06-10 Thread Fontenot, Paul
You are the man, thanks. That was exactly what I needed. -Original Message- From: Hanson, Robert [mailto:[EMAIL PROTECTED]] Sent: Monday, June 10, 2002 10:02 AM To: Fontenot, Paul; Perl - Beginners (E-mail) Subject: RE: Spaces... Try /\s+/ >From the perlre manpage: \s Matc

Re: Spaces...

2002-06-10 Thread David vd Geer Inhuur tbv IPlib
Hi Paul, Just use : ($month, $day, $time) = (split /\s+/, $line); the /s+ stands for 1 or more spaces. Regs David - > > I have a logfile that has the following format: > > month day time > > The problem is splitting on the "space" - split(/ /). Sometimes there are more tha

RE: Spaces...

2002-06-10 Thread Hanson, Robert
Try /\s+/ >From the perlre manpage: \s Match a whitespace character + Match 1 or more times Rob -Original Message- From: Fontenot, Paul [mailto:[EMAIL PROTECTED]] Sent: Monday, June 10, 2002 1:02 PM To: Perl - Beginners (E-mail) Subject: Spaces... I have a logfile that has the fo

RE: spaces...

2001-06-02 Thread Jeff Pinyan
On Jun 2, Chas Owens said: >On 02 Jun 2001 01:19:35 -0700, Paul Fontenot wrote: >> It is a system logfile. That is the way syslog is dumping it into the log. > >Can you give an example of a line from each month? The file has two spaces before the 10th of every month. That's more like 1/3 of the

RE: spaces...

2001-06-02 Thread Chas Owens
02, 2001 12:59 AM > To: Paul Fontenot > Cc: [EMAIL PROTECTED] > Subject: Re: spaces... > > If your data is not supposed to have spaces in it you could say: > > $record = split / +/, $line; > > " +" is regexp for "one or more spaces. > > Wh

RE: spaces...

2001-06-02 Thread Paul Fontenot
It is a system logfile. That is the way syslog is dumping it into the log. -Original Message- From: Chas Owens [mailto:[EMAIL PROTECTED]] Sent: Saturday, June 02, 2001 12:59 AM To: Paul Fontenot Cc: [EMAIL PROTECTED] Subject: Re: spaces... If your data is not supposed to have spaces in

Re: spaces...

2001-06-02 Thread Chas Owens
If your data is not supposed to have spaces in it you could say: $record = split / +/, $line; " +" is regexp for "one or more spaces. What you really need to do is understand why your field seperator changes halfway through the month. On 01 Jun 2001 23:19:24 -0700, Paul Fontenot wrote: > I hav