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
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
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
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
"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
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
"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
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
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
> -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
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
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
> -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
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
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
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
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
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
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
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
20 matches
Mail list logo