On 01/08/2011 19:14, Dr.Ruud wrote:
my ($rtioverview) = $string =~ /(.{0,100})\b/;
That would have to be
my ($rtioverview) = $string =~ /(.{0,99})\S\b/;
to avoid terminating at the start of a non-space sequence.
Rob
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional
On 2011-07-28 15:23, Khabza Mkhize wrote:
I want to substring words, I might be using wrong terminology. But I tried
the following example the only problem I have it cut word any where it
likes. eg "breathtaking" on my string is only bre.
$string = "This is an awe-inspiring tour to the
My first impression was that he wanted the first hundred characters
rounded off to the previous or next full word. It sounded like he wanted
smart line breads at the word boundaries.
Bob McConnell
From: timothy adigun
> I get the point you are making here, if you check the subroutine "sub
> che
Hi Rob,
I get the point you are making here, if you check the subroutine "sub
checkStr{}" you see dat it confirm what you are pointing out. However, I
think the point there is the number of words the programmers wants! [Khabza,
correct me if am wrong].
Since, split function as indicated will remov
On 28/07/2011 14:23, Khabza Mkhize wrote:
I want to substring words, I might be using wrong terminology. But I tried
the following example the only problem I have it cut word any where it
likes. eg "breathtaking" on my string is only bre.
$string = "This is an awe-inspiring tour to the
Hello Khabza,
" I want to substring words, I might be using wrong terminology. But I tried
the following example the only problem I have it cut word any where it
likes. eg "breathtaking" on my string is only bre."
-- If you count your $string alphabeth by alphabeth from 0 to 100 including
eve
Hi Rob Coops,
" I want to substring words, I might be using wrong terminology. But I tried
the following example the only problem I have it cut word any where it
likes. eg "breathtaking" on my string is only bre."
-- If you count your $string alphabeth by alphabeth from 0 to 100 including
ev
On Thu, Jul 28, 2011 at 3:23 PM, Khabza Mkhize wrote:
> I want to substring words, I might be using wrong terminology. But I tried
> the following example the only problem I have it cut word any where it
> likes. eg "breathtaking" on my string is only bre.
>
>
> $string = "This is an awe-in
Nishi wrote:
I have a string of the format -
abc/def/ghi
or
abc\def\ghi
I want to strip of abc and return just
def/ghi
or
def\ghi
How do I do that?
use strict;
use warnings;
foreach (qw( abc/def/ghi abc\def\ghi )) {
(my $trim = $_) =~ s|.*?[/\\]||;
print "$_ -> $trim\n";
}
**OUTPUT**
On 8/17/05, Paul Johnson <[EMAIL PROTECTED]> wrote:
> On Wed, Aug 17, 2005 at 06:26:16PM +0100, marcos rebelo wrote:
>
> > If I'm not wrong, Changing this lines:
> >
> > my @col = grep(!/\t/, split(/(\t)/, $line));
> > push(@col, "") if $line =~ /\t$/;
> >
> >
> > b
On Wed, Aug 17, 2005 at 06:26:16PM +0100, marcos rebelo wrote:
> If I'm not wrong, Changing this lines:
>
> my @col = grep(!/\t/, split(/(\t)/, $line));
> push(@col, "") if $line =~ /\t$/;
>
>
> by
>
>
> $line .= "\t";
> my @col;
On Aug 17, marcos rebelo said:
my @col = grep(!/\t/, split(/(\t)/, $line));
push(@col, "") if $line =~ /\t$/;
Wow. That could have just been
my @col = split /\t/, $line;
push @col, "" if $line =~ /\t$/;
which should REALLY have been written as
my @col = split /\t/, $line, -1;
The
thanks a lot. - tao
--- "John W. Krahn" <[EMAIL PROTECTED]> wrote:
> Tao Wang wrote:
> >
> > thanks a lot. But there is one problem - this is
> my
> > fault. The KEY1, KEY2 don't exactly look like
> this.
> > There are six KEYS. Three are related to KEYS, but
> the
> > rest of them are A_BEG A
Tao Wang wrote:
> thanks a lot. But there is one problem - this is my
> fault. The KEY1, KEY2 don't exactly look like this.
> There are six KEYS. Three are related to KEYS, but the
> rest of them are A_BEG A_END, B_OPTIONS, and I need to
> extract information between them. I used one variable
> $o
no special order. thanks. - tao
--- Wiggins d'Anconia <[EMAIL PROTECTED]> wrote:
>
>
> tao wang wrote:
> > thanks a lot. But there is one problem - this is
> my
> > fault. The KEY1, KEY2 don't exactly look like
> this.
> > There are six KEYS. Three are related to KEYS, but
> the
> > rest of
tao wang wrote:
thanks a lot. But there is one problem - this is my
fault. The KEY1, KEY2 don't exactly look like this.
There are six KEYS. Three are related to KEYS, but the
rest of them are A_BEG A_END, B_OPTIONS, and I need to
extract information between them. I used one variable
$op=KEY1|
Tao Wang wrote:
>
> thanks a lot. But there is one problem - this is my
> fault. The KEY1, KEY2 don't exactly look like this.
> There are six KEYS. Three are related to KEYS, but the
> rest of them are A_BEG A_END, B_OPTIONS, and I need to
> extract information between them. I used one variable
>
thanks a lot. But there is one problem - this is my
fault. The KEY1, KEY2 don't exactly look like this.
There are six KEYS. Three are related to KEYS, but the
rest of them are A_BEG A_END, B_OPTIONS, and I need to
extract information between them. I used one variable
$op=KEY1|KEY2|KEY3|A_BEG|A_
Tao Wang wrote:
>
> Hi Everyone,
Hello,
> I'm having a problem with extracting certain strings
> within a line. I tried several ways, but not very
> inefficient. Can somebody help me with it? thanks a
> lot.
>
> The line might be one of the following:
> KEY1 3 4 T KEY2
>
> KEY1 3
tao wang wrote:
Hi Everyone,
I'm having a problem with extracting certain strings
within a line. I tried several ways, but not very
inefficient. Can somebody help me with it? thanks a
lot.
The line might be one of the following:
KEY1 3 4 T KEY2
KEY1 3 4 T KEY2 456 67 KEY3
K
Tao Wang wrote:
> Hi Everyone,
>
> I'm having a problem with extracting certain strings
> within a line. I tried several ways, but not very
> inefficient. Can somebody help me with it? thanks a
> lot.
>
> The line might be one of the following:
> KEY1 3 4 T KEY2
>
> KEY1 3 4 T KEY2 45
On Mon, Oct 21, 2002 at 04:32:27PM -0500, Akens, Anthony wrote:
[snip]
It looks like you forgot -w and use strict.
> open (NAMES, $namefile)
> or print "Could not open $namefile $!";
Do you really want to continue and read the file if the open fails?
> while()
> {
> ($key, $value
print $displayname;
print "<\/a>\n";
}
}
-
-Original Message-
From: Larry Coffin [mailto:lc2002@;PointInfinity.com]
Sent: Monday, October 21, 2002 2:53 PM
To: Akens, Anthony; [EMAIL PROTECTED]
Subject: Re: Substring and Sort
At 3:03 PM -0400 10/21
At 3:03 PM -0400 10/21/02, Akens, Anthony wrote:
>I'm attempting to use the following code to read a file
>in the format of:
>
>directory name:displayname
>
>I want to sort the list by the "displayname", looking
>at the first letter for each display name in the file.
>If it's unique, I want to prin
Anthony Akens wrote:
> I'm attempting to use the following code to read a file
> in the format of:
>
> directory name:displayname
>
> I want to sort the list by the "displayname", looking
> at the first letter for each display name in the file.
> If it's unique, I want to print it. This should
On 20/6/01 at 3:44 pm, [EMAIL PROTECTED] (Michael Fowler) wrote:
Thank for your help, I'll try some of it out and let you know. The data
comes from a mainframe system and going to be loaded into MS SQL Server
database. I am really impressed by Perl, it can do easy things so
quickly.
>
> > my @
On Thu, Jun 21, 2001 at 08:29:05PM +0100, Mark Bedish wrote:
> I am putting tabs between the fields and then changing the a13 which is
> a tso overpunch to its decimal equiv, e.g. 1234} means -123.40 .
How.. odd.
> As I hinted, my code is very procedural as I am not used to Perl yet.
Procedur
On Wed, Jun 20, 2001 at 11:41:29PM +0100, Mark Bedish wrote:
> I am using substrings in a screipt and wondered if there was a better
> perlish way to do it. I am taking data from a mainframe system and
> reformatting it but the substring seems to be quite slow, like visual
> basic, the original.
>
- Original Message -
From: Hasanuddin Tamir <[EMAIL PROTECTED]>
To: Nathaniel Mallet <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, June 05, 2001 8:38 PM
Subject: Re: Substring retrieval
> On Tue, 5 Jun 2001, Nathaniel Mallet <[EMAIL PROTECTED]
On Tue, 5 Jun 2001, Nathaniel Mallet <[EMAIL PROTECTED]> wrote,
> The Index function isn't listed on the perl.com website, which was the only
> place I looked for documentation up until now. I haven't recieved my Perl
> books from Fatbrain yet. ;-)
It's always right there (among other functions
t; <[EMAIL PROTECTED]>
To: "Nathaniel Mallet" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, June 04, 2001 10:21 PM
Subject: Re: Substring retrieval
> On Mon, 4 Jun 2001, Nathaniel Mallet <[EMAIL PROTECTED]> wrote,
>
> > Date: Mon, 4 Ju
Good day;
At 08:17 AM 6/5/2001 -0700, Paul wrote:
>--- Nathaniel Mallet <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I'm trying to retrieve a substring from a string, but I'm not
> > sure exactly where and how big that substring is. The substring is
> > delimited by a start and end special char
--- Nathaniel Mallet <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm trying to retrieve a substring from a string, but I'm not
> sure exactly where and how big that substring is. The substring is
> delimited by a start and end special character. It was suggested to
> me to write two regular express
On Mon, 4 Jun 2001, Nathaniel Mallet <[EMAIL PROTECTED]> wrote,
> Date: Mon, 4 Jun 2001 21:06:43 -0400
> From: Nathaniel Mallet <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Substring retrieval
>
> Hi,
>
> I'm trying to retrieve a substring from a string, but I'm not sure
> exact
Ok,
the best way (in my opinion), would be, assuming 's' and 'e' are the
start/end special characters:
$string =~ s/^.*?(s.*e).*$/$1/;
- Original Message -
From: "Nathaniel Mallet" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 04, 2001 9:06 PM
Subject: Substring retrieval
35 matches
Mail list logo