> -Original Message-
> From: Grant [mailto:emailgr...@gmail.com]
> Sent: Tuesday, April 21, 2009 12:55
> To: Perl Beginners List
> Subject: Re: String manipulation question
>
> >> >> >> Thanks guys. With some help I've come up with this:
> -Original Message-
> From: Grant [mailto:emailgr...@gmail.com]
> Sent: Tuesday, April 21, 2009 12:43
> To: Perl Beginners List
> Subject: Re: String manipulation question
>
> >> >> Thanks guys. With some help I've come up with this:
> >>
> -Original Message-
> From: Grant [mailto:emailgr...@gmail.com]
> Sent: Tuesday, April 21, 2009 12:16
> To: Perl Beginners List
> Subject: Re: String manipulation question
>
> >> Thanks guys. With some help I've come up with this:
> >>
> >
> -Original Message-
> From: Grant [mailto:emailgr...@gmail.com]
> Sent: Tuesday, April 21, 2009 11:47
> To: Perl Beginners List
> Subject: Re: String manipulation question
>
> >> I'd like to take a string and manipulate it in a few ways.
> >>
&g
> -Original Message-
> From: Grant [mailto:emailgr...@gmail.com]
> Sent: Tuesday, April 21, 2009 09:58
> To: Perl Beginners List
> Subject: String manipulation question
>
> I'd like to take a string and manipulate it in a few ways.
>
> If the string is 34
>>> if you have in $string = q[1234 12345 12 5346 12367 123 123678123];
>>> Then $var1 will be '1234 12345 12 5346 12367 123 12367', but I thought you
>>> wanted '1234 12345 12 5346 12367 123'?
>>> Which one is the right one for what you are doing?
>>
>> You're right, I would want:
>>
>> 1234 12345
>> >> >> >> Thanks guys. With some help I've come up with this:
>> >> >> >>
>> >> >> >> $string = 'abc def ghi jkl mno pqr stu vwx yz';
>> >> >> >> if(length($string) = 34) {$var1 = $string.":";}
>> >> >> >
>> >> >> > '=' is assignment, '==' is test for numerical equality.
>> >> >> Change the abov
On 4/21/09 Tue Apr 21, 2009 11:54 AM, "Grant"
scribbled:
>> if you have in $string = q[1234 12345 12 5346 12367 123 123678123];
>> Then $var1 will be '1234 12345 12 5346 12367 123 12367', but I thought you
>> wanted '1234 12345 12 5346 12367 123'?
>> Which one is the right one for what you are
On 4/21/09 Tue Apr 21, 2009 11:42 AM, "Grant"
scribbled:
> I'm trying to pull 35 or fewer characters to the nearest space
> basically. This is what I have now:
>
> if(length($string) <= 34) {$var1 = $string.":";}
> if(length($string) > 34) {
> ($var1, $var2) = ($string =~ /(.{35})(.{26})/);
>> >> >> Thanks guys. With some help I've come up with this:
>> >> >>
>> >> >> $string = 'abc def ghi jkl mno pqr stu vwx yz';
>> >> >> if(length($string) = 34) {$var1 = $string.":";}
>> >> >
>> >> > '=' is assignment, '==' is test for numerical equality.
>> >> Change the above
>> >> > line to:
>>
>> >> Thanks guys. With some help I've come up with this:
>> >>
>> >> $string = 'abc def ghi jkl mno pqr stu vwx yz';
>> >> if(length($string) = 34) {$var1 = $string.":";}
>> >
>> > '=' is assignment, '==' is test for numerical equality.
>> Change the above
>> > line to:
>> > if( length($string
$string =~ s/\s//g;
>>>
>>> The above line deletes all of the spaces in $string. Is that what you want
>>> to do?
>>
>> All fixed up except for this. How can I remove only the spaces at the
>> end of $var1 and $var2 if they exist?
>
> Anchor your substitution regular expression to the end o
On 4/21/09 Tue Apr 21, 2009 11:16 AM, "Grant"
scribbled:
>>> $string =~ s/\s//g;
>>
>> The above line deletes all of the spaces in $string. Is that what you want
>> to do?
>
> All fixed up except for this. How can I remove only the spaces at the
> end of $var1 and $var2 if they exist?
Anc
>> Thanks guys. With some help I've come up with this:
>>
>> $string = 'abc def ghi jkl mno pqr stu vwx yz';
>> if(length($string) = 34) {$var1 = $string.":";}
>
> '=' is assignment, '==' is test for numerical equality. Change the above
> line to:
> if( length($string) == 34 ) { $var1 = $string
On 4/21/09 Tue Apr 21, 2009 10:46 AM, "Grant"
scribbled:
> Thanks guys. With some help I've come up with this:
>
> $string = 'abc def ghi jkl mno pqr stu vwx yz';
> if(length($string) = 34) {$var1 = $string.":";}
'=' is assignment, '==' is test for numerical equality. Change the above
line t
>> I'd like to take a string and manipulate it in a few ways.
>>
>> If the string is 34 characters or less, I'd like to append a colon
>> character and save it to $var1.
>
> The length function will tell you how many characters are in a string.
>
>>
>> If the string is longer than 34 characters, I'
On 4/21/09 Tue Apr 21, 2009 8:58 AM, "Grant"
scribbled:
> I'd like to take a string and manipulate it in a few ways.
>
> If the string is 34 characters or less, I'd like to append a colon
> character and save it to $var1.
The length function will tell you how many characters are in a string.
I'd like to take a string and manipulate it in a few ways.
If the string is 34 characters or less, I'd like to append a colon
character and save it to $var1.
If the string is longer than 34 characters, I'd like to save up to 35
characters to $var1, but cut off at the last possible space character
Andrew Curry schreef:
> /\s*(\S+)\s*=\s*(\S+)[,\s*\/*]?/
Anchored alternative:
/^\s*(\w+)\s*=\s*(\w+)/
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Thanks Everyone for your suggestions. It really helped.
I shall freshen up from the documents suggested to me.
But anyways, i would like to say, that unless any one works on any language,
mastering it is difficult. When i go through the tutorials or documents, i
seem to know. But practically, onl
But in this case it was also not needed as I replied without actually
reading the requirements.
-Original Message-
From: Paul Lalli [mailto:[EMAIL PROTECTED]
Sent: 31 July 2007 14:21
To: beginners@perl.org
Subject: Re: String Manipulation
On Jul 31, 8:40 am, [EMAIL PROTECTED
On Jul 31, 8:40 am, [EMAIL PROTECTED] (Dharshana Eswaran) wrote:
> And your suggestion worked. Thank you. But in the string which u had
> suggested, [,\s*\/*]?, here \s* => tells spaces are optional,
No it doesn't. The "dirty dozen" characters lose their special
meaning inside of a character clas
>
>
> -Original Message-
> From: Dharshana Eswaran [mailto:[EMAIL PROTECTED]
> Sent: 31 July 2007 13:17
> To: Perl Beginners
> Subject: String Manipulation
>
> Hi All,
>
> I have a string which reads
> $str5 = "DL_FEM_ADJ1 = DL_FEM_LINE_FIRST, /* Keep t
Dharshana Eswaran wrote:
I have a string which reads
$str5 = "DL_FEM_ADJ1 = DL_FEM_LINE_FIRST, /* Keep the adjacent ones
consecutive */";
Here i need to consider the variable and its value, ignoring the comment.
I have a pattern which reads
if($str5 =~ /\s*([A-Z_]+)\s=\s(\w+),*/) {
pr
Try
if($str5 =~ /\s*(\S+)\s*=\s*(\S+)[,\s*\/*]?/)
I cant see how your
([A-Z_]+)
Will match your DL_FEM_ADJ1 as this has a number on it?
-Original Message-
From: Dharshana Eswaran [mailto:[EMAIL PROTECTED]
Sent: 31 July 2007 13:17
To: Perl Beginners
Subject: String Manipulation
Hi All,
I have a string which reads
$str5 = "DL_FEM_ADJ1 = DL_FEM_LINE_FIRST, /* Keep the adjacent ones
consecutive */";
Here i need to consider the variable and its value, ignoring the comment.
I have a pattern which reads
if($str5 =~ /\s*([A-Z_]+)\s=\s(\w+),*/) {
print "$1 and $2\n";
On 6/27/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote:
On 6/28/07, Tom Phoenix <[EMAIL PROTECTED]> wrote:
>
> On 6/27/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote:
>
> > I am unable to get a generalised way in which it can extract them as few
> > structures have comments, few does not hav co
On 6/28/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote:
Thank you. But i am unable to understand the working of the code which you
have written. Can you please explain it?
Thanks and Regards,
Dharshana
What, specifically, do you not understand?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
Fo
Thank you. But i am unable to understand the working of the code which you
have written. Can you please explain it?
Thanks and Regards,
Dharshana
On 6/28/07, Chas Owens <[EMAIL PROTECTED]> wrote:
On 6/27/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote:
> On 6/28/07, Tom Phoenix <[EMAIL PROTECT
On 6/27/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote:
On 6/28/07, Tom Phoenix <[EMAIL PROTECTED]> wrote:
>
> On 6/27/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote:
>
> > I am unable to get a generalised way in which it can extract them as few
> > structures have comments, few does not hav co
On 6/27/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote:
I am restricted from using modules and i am unable to come up
with a regex or regexes to do this job.
So, the Pointy-Haired Boss won't let you use any module that didn't
come with Perl?
Even if you can't use Parse::RecDescent in your fi
On 6/28/07, Tom Phoenix <[EMAIL PROTECTED]> wrote:
On 6/27/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote:
> I am unable to get a generalised way in which it can extract them as few
> structures have comments, few does not hav comments etc.
Does the data have some defined grammar, or a defina
On 6/27/07, Tom Phoenix <[EMAIL PROTECTED]> wrote:
snip
Does the data have some defined grammar, or a definable one at least?
If you are up to using Parse::RecDescent, it will probably do the job.
snip
Many people are afraid to use Parse::RecDescent because of the
learning curve involved. I fi
On 6/27/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote:
I am unable to get a generalised way in which it can extract them as few
structures have comments, few does not hav comments etc.
Does the data have some defined grammar, or a definable one at least?
If you are up to using Parse::RecDesc
Hi All,
I have a string in which structures are stored. Each time i read a file,
different structure in stored in the string. The different possible
structures stored in the string is as shown:
$string = "{
STACK_CC_SS_COMMON_TYPE_REFERENCE_ID_Tpp_reference_id;
STACK_CC_SS_COMMON_TYPE_
whether he's really
sure that it's more efficient to waste time with Java or to teach one
more guy some Perl.
> > 2. Does anyone know if the java would be significantly improved if I
> > make use of regex instead of using substring functions?
>
> Why do you ask thi
On 6/24/07, Jeni Zundel <[EMAIL PROTECTED]> wrote:
1. Is the java significantly slower than the perl script because I
suck at writing efficient java code or because perl is just really
that much better at string manipulation?
Yes.
If it's important to determine how much of your
t is significantly less efficient than the perl script. So my
questions are:
1. Is the java significantly slower than the perl script because I
suck at writing efficient java code or because perl is just really
that much better at string manipulation?
and
2. Does anyone know if the j
James Edward Gray II wrote:
> Then you didn't read the documentation I sent you the link for. ;)
>
> A negative index counts backwards from the end of the string.
i did read it. maybe i should have asked my question like this: "why is
the 3rd argument negative when you can simply say:
substr($
On Aug 19, 2004, at 11:55 AM, Christopher J. Bottaro wrote:
Gunnar Hjalmarsson wrote:
You can use substr() as an rvalue:
substr($str1, 4, 8 - length $str1, $str2);
or if the length of $str1 is given:
substr($str1, 4, -4, $str2);# probably fastest
i don't understand why the 3rd
Gunnar Hjalmarsson wrote:
> You can use substr() as an rvalue:
>
> substr($str1, 4, 8 - length $str1, $str2);
>
> or if the length of $str1 is given:
>
> substr($str1, 4, -4, $str2);# probably fastest
i don't understand why the 3rd argument is negative.
given $str1 = 'xxx
Christopher J. Bottaro wrote:
say i have two strings "" and "". i want to
replace characters 4-7 in the first string with the second string
with an emphasis on speed.
basically i want to do what can be done in c with the following:
char str1[13] = "";
char *str2 = "
On Aug 19, 2004, at 10:55 AM, James Edward Gray II wrote:
On Aug 19, 2004, at 10:55 AM, Christopher J. Bottaro wrote:
say i have two strings "" and "". i want to replace
characters 4-7 in the first string with the second string with an
emphasis
on speed.
perldoc -f substring
Egad,
On Aug 19, 2004, at 10:55 AM, Christopher J. Bottaro wrote:
say i have two strings "" and "". i want to replace
characters 4-7 in the first string with the second string with an
emphasis
on speed.
perldoc -f substring
Come back if you need a bigger hint. ;)
James
--
To unsubscrib
say i have two strings "" and "". i want to replace
characters 4-7 in the first string with the second string with an emphasis
on speed.
basically i want to do what can be done in c with the following:
char str1[13] = "";
char *str2 = "";
strncpy(str1+4, str2, 4);
Jerry Preston wrote:
> Hi!
>
> I am trying to figure out a simple, Perl way to break down any sting
> similar to the following:
>
> $s0 =
>
"01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,
> 26,27,28,29";
>
> Or in any numeric order. The string cannot be longer than
On Mon, 19 Jan 2004, Jerry Preston wrote:
> I am trying to figure out a simple, Perl way to break down any sting similar
> to the following:
>
> $s0 =
> "01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,
> 26,27,28,29";
>
> Or in any numeric order. The string cannot b
Hi!
I am trying to figure out a simple, Perl way to break down any sting similar
to the following:
$s0 =
"01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,
26,27,28,29";
Or in any numeric order. The string cannot be longer than 55 characters and
end with ",".
Ex:
$s
Chinku Simon <[EMAIL PROTECTED]> wrote:
:
: I am facing a problem with text file manipulation
: with Perl.
:
: I have a file with over 2 lac lines of data.
Strange. It looks like you've posted a similar
message yesterday, except that file had a lot more
blank lines. Have you made no progre
Hi,
I am facing a problem with text file manipulation with Perl.
I have a file with over 2 lac lines of data.
I need to find the duplicates(strings) in the file and copy those records into another
file.
Is there a function/module in Perl by which I can read the duplicates in a file at
one
03 5:36 PM
To: [EMAIL PROTECTED]
Subject: Re: String manipulation problem
[EMAIL PROTECTED] wrote:
> Hi,
>
> While reading each line in a file, If I find a certain number, I need
> to increment a digit within that number. For example, when reading
> through my file, I expect t
[EMAIL PROTECTED] wrote:
> Hi,
>
> While reading each line in a file, If I find a certain number, I need to
> increment a digit within that number. For example, when reading through my
> file, I expect to find the following line.
>
> #define DS_FILEVERSION7,0,0,0462
>
> What I want to d
[EMAIL PROTECTED] wrote:
> Hi,
>
> While reading each line in a file, If I find a certain number, I need
> to increment a digit within that number. For example, when reading
> through my file, I expect to find the following line.
>
> #define DS_FILEVERSION 7,0,0,0462
>
> What I want to do is have t
> #define DS_FILEVERSION7,0,0,0462
>
> What I want to do is have the ability to increment the first
> two zero's
> after the 7 on demand. I may accasionaly want to increment
> the first zero,
> making the number 7,1,0,0462, or a I may want to just
> increment the second
> zero, making t
27;, @nums); # returns the comma delimited nums
}
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 10:14 AM
To: [EMAIL PROTECTED]
Subject: String manipulation problem
Hi,
While reading each line in a file, If I find a certain number,
Hi,
While reading each line in a file, If I find a certain number, I need to
increment a digit within that number. For example, when reading through my
file, I expect to find the following line.
#define DS_FILEVERSION 7,0,0,0462
What I want to do is have the ability to increment the first two
From: "John W. Krahn" <[EMAIL PROTECTED]>
> Pavle Lukic wrote:
> > Problem
> > Given a string and a pattern, construct new string
> > by removing part of the string equal to pattern.
> > Remove only first occurrence of the pattern.
> >
> > Problem solutions
> >
> > Solution #1 ($x = $a) =~ s/\Q$b
nd perhaps
why the second takes appx half the time to do?
I'd love to understand this better.
Thanks
Dan
-Original Message-
From: John W. Krahn [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 08, 2003 9:37 AM
To: [EMAIL PROTECTED]
Subject: Re: String manipulation benchmark
Pavle Lukic wrote:
>
> Hi
Hello,
> I did a little benchmarking in regard to the
> string manipulation issue raised on this forum.
>
> Here are relevant parameters and benchmark results.
>
> Problem
> Given a string and a pattern, construct new string
> by removi
Hi
I did a little benchmarking in regard to the
string manipulation issue raised on this forum.
Here are relevant parameters and benchmark results.
Problem
Given a string and a pattern, construct new string
by removing part of the string equal to pattern.
Remove only first occurrence of the
> vec() is a bit squirrelly. In a nutshell (heh), vec views its first
> argument as a stream of bits taken from the string. The third
> argument tells how many bits form a chunk. 8 bits gives chunks that
> can each have values from 0 to 255. The second argument tells *which*
> chunk, numbering
> "James" == James Kipp <[EMAIL PROTECTED]> writes:
>> vec( $output, length $output, 8 ) = ord "E";
James> is it just me or do others on this list have a tough time understanding the
James> vec() function?
vec() is a bit squirrelly. In a nutshell (heh), vec views its first
argument as a stre
ebmaster Insane Hosts)
www.insane-hosts.net
MSN: [EMAIL PROTECTED]
From: "Kipp, James" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: RE: PERL string manipulation
Date: Fri, 20 Dec 2002 08:29:14 -0500
> vec( $output, length $output, 8 ) = ord "E";
is it just me
> vec( $output, length $output, 8 ) = ord "E";
is it just me or do others on this list have a tough time understanding the
vec() function?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Colin Johnstone wrote:
>
> Gidday all,
Hello,
> In PHP if I want to add something to a string I do this
>
> $output = "";
>
> $output .= "A";
> $output .= "B";
> $output .= "C";
> $output .= "D";
>
> print $output;
>
> How do I do the same in PERL please.
That does the same thing in perl:
Let us know and maybe we can help.
Wags ;)
-Original Message-
From: Johnstone, Colin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 19, 2002 21:26
To: '[EMAIL PROTECTED]'
Subject: RE: PERL String Manipulation
Gidday All,
Thank You for your help, I must have some other
Gidday All,
Thank You for your help, I must have some other error that I can't find.
Regards
Colin
The same way.
Wags ;)
-Original Message-
From: Johnstone, Colin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 19, 2002 21:01
To: '[EMAIL PROTECTED]'
Subject: PERL string manipulation
Gidday all,
In PHP if I want to add something to a string I do this
Gidday all,
In PHP if I want to add something to a string I do this
$output = "";
$output .= "A";
$output .= "B";
$output .= "C";
$output .= "D";
print $output;
How do I do the same in PERL please.
Thanking you in anticipation
Colin
Thanks John,
I may have to go along with Drieux and "Let it be known" YOU are The GOD
of regEx!
-Original Message-
From: John W. Krahn [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 6:48 PM
To: [EMAIL PROTECTED]
Subject: Re: string manipulation
Jaimee Spe
On Wednesday, May 1, 2002, at 06:47 , John W. Krahn wrote:
> Jaimee Spencer wrote:
[..]
>>
>>I know I am missing something basic here also, but tell me in the
>> example
>> (my $projectId) = $projectDocDir =~ m!.*/(\w+)/!;
>> why isn't the /1_0001.doc being printed as well?
>
> Because the
Jaimee Spencer wrote:
>
> From: John W. Krahn [mailto:[EMAIL PROTECTED]]
> >
> > Either of these should work:
> >
> > (my $projectId) = $projectDocDir =~ m!.*/(\w+)/!;
> >
> > # or
> >
> > my $projectId = (split /\//, $projectDocDir)[-2];
>
>I know I am missing something basic here also,
EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 4:18 PM
To: [EMAIL PROTECTED]
Subject: Re: string manipulation
Garrett Esperum wrote:
>
> Hi all,
Hello,
> I am using Solaris, Perl 5.
> I am having some problems manipulating strings.
> The string I am manipulating is:
>
>
On Wednesday, May 1, 2002, at 04:18 , John W. Krahn wrote:
> Garrett Esperum wrote:
[..]
>>
>> /export/home/user/www/doc-root/dir/projects/19463/1_0001.doc
>>
>> $projectId = substr($projectDocDir, length($dir), index($projectDocDir,
>> "/",
>> length($dir)));
you might want to perldoc File::B
EMAIL PROTECTED]
Subject: Re: string manipulation
On Wed, 2002-05-01 at 18:52, garrett esperum wrote:
> Hi all,
>
> I am using Solaris, Perl 5.
>
> I am having some problems manipulating strings.
>
> The string I am manipulating is:
>
> /export/home/user/www/doc-ro
On Wed, 2002-05-01 at 18:52, garrett esperum wrote:
> Hi all,
>
> I am using Solaris, Perl 5.
>
> I am having some problems manipulating strings.
>
> The string I am manipulating is:
>
> /export/home/user/www/doc-root/dir/projects/19463/1_0001.doc
>
> I am trying to take out the "19463" part
Garrett Esperum wrote:
>
> Hi all,
Hello,
> I am using Solaris, Perl 5.
> I am having some problems manipulating strings.
> The string I am manipulating is:
>
> /export/home/user/www/doc-root/dir/projects/19463/1_0001.doc
>
> I am trying to take out the "19463" part from the string and insert
Hi all,
I am using Solaris, Perl 5.
I am having some problems manipulating strings.
The string I am manipulating is:
/export/home/user/www/doc-root/dir/projects/19463/1_0001.doc
I am trying to take out the "19463" part from the string and insert it into
a variable.
Example of my code to do
In article <00bb01c1b645$0b8eef80$[EMAIL PROTECTED]> wrote "Brian Johnson"
<[EMAIL PROTECTED]>:
> I have the following code that I need a little advice on.
It'e easier for us all,
if you short describe your problem.
I assume that the following contains some errors,
you can't find.
>
> The $re
;,'Nov','De
c');
#convert the date
$threeLetterMonth = $mons[$record->{month}];
-Original Message-----
From: Brian Johnson [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 9:20 AM
To: [EMAIL PROTECTED]
Subject: More string manipulation
I have the follo
I have the following code that I need a little advice on.
The $record->{month} returns the month in integer format (ie 1, 2, 3), I
need to change it to to a three letter string (ie Jan, Feb, Mar)
foreach $item (@items) {
my $record;
my $test;
foreach $record (@{$PDB->{records}}) {
In article <[EMAIL PROTECTED]> wrote "Brett
W. McCoy"
<[EMAIL PROTECTED]>:
> On Thu, 14 Feb 2002, Brian Johnson wrote:
>
>> I need a string in the form
>> Wed, 18 Jul 2001 14:20
>>
>> Of course my line doesn't quite cut it.
>> my $emaildate = join " ", $record->{day}, $record->{month},
>>
On Thu, 14 Feb 2002, Brian Johnson wrote:
> I need a string in the form
> Wed, 18 Jul 2001 14:20
>
> Of course my line doesn't quite cut it.
> my $emaildate = join " ", $record->{day}, $record->{month},
> $record->{year}, $record->{hour}, $record->{minute};
Just interpolate the variables d
I need a string in the form
Wed, 18 Jul 2001 14:20
Of course my line doesn't quite cut it.
my $emaildate = join " ", $record->{day}, $record->{month},
$record->{year}, $record->{hour}, $record->{minute};
I'm weak in string manipulation in perl - any h
30:56 +0530 (IST)
From: Deen Hameed <[EMAIL PROTECTED]>
To: Hubert Ian M. Tabug <[EMAIL PROTECTED]>
Cc: Perl <[EMAIL PROTECTED]>
Subject: Re: string manipulation
something like this should work...
(@somearray) = split(/\(.*\)/, $a);
On Sat, 26 Jan 2002, Hubert Ia
>
| Given the string:
|
| $a = "xxx xxx xxx xxx xxx xxx xxx (Jan 12 1990 ..)"
|
| I want to selectively extract that part of the string
| having the (Jan 12 1990 ...) and store it in an array.
| Can someone guide me?
:
: something like this should work...
:
: (@somearray) = split(/\(.*
something like this should work...
(@somearray) = split(/\(.*\)/, $a);
On Sat, 26 Jan 2002, Hubert Ian M. Tabug wrote:
> Hi,
>
> Given the string $a = "xxx xxx xxx xxx xxx xxx xxx (Jan 12
> 1990 ..)", I wan't to selectively extract that part of the string
> having the
Hi,
Given the string $a = "xxx xxx xxx xxx xxx xxx xxx (Jan 12 1990 ..)",
I wan't to selectively extract that part of the string having the (Jan 12 1990 ...)
and store it in an array. Can someone guide me?
Thanks,
Hubert
> Whats a bash prompt??
A shell prompt (bash is a 'shell'). Otherwise known as
a command line. A place where you type in commands.
I guess you ain't using a flavor of unix.
If you're using Windows, you can do roughly the same
thing as I suggested, only you'll need to fiddle with the
characters
Whats a bash prompt??
Ok OK let me see if i have it
the name of the string is EightyCharsLong
$EightyCharsLong
and the substr command is like the midstring command
substr()
I'm going to guess the first charecter is 0 so that 19 becomes the 20th position???
and of course the 10 is for the legt
> In BASIC there are commands for
> leftstring, midstring, and rightstring.
> I am looking for the perl equiv for these.
> Lets say i have a string 80 charecters long and i
> want to insert at string position 20 for 10 charecters.
substr($EightyCharsLong, 19, 10) = 'morestring';
Yes, you ca
OK.. thanks to all who helped me... i'm actually learning this thing... perl
In BASIC there are commands for leftstring, midstring, and rightstring.
I am looking for the perl equiv for these.
maybe an example too??? not in butt tight code, but in line by line code so I can
learn.
THEN I'll
92 matches
Mail list logo