Hi Chris,
On Thu, 15 Dec 2011 11:58:00 -0600
Chris Stinemetz wrote:
> On Thu, Dec 15, 2011 at 10:42 AM, Dr.Ruud wrote:
> > On 2011-12-14 05:43, Chris Stinemetz wrote:
> >
> >> I am trying to split the first element of an array by white space then
> >> continue reading the rest of the file.
> >>
>
> Is that your company's policy, or do you just lack root access? If it's the
> latter, then see the various resources at http://perl-begin.org/topics/cpan/ ,
> so you can see how to install Perl modules from CPAN under your home
> directory.
>
It isn't a company policy just circumstance. The u
Hi Chris,
On Thu, 15 Dec 2011 15:29:08 -0600
Chris Stinemetz wrote:
> >
> > Is that your company's policy, or do you just lack root access? If it's the
> > latter, then see the various resources at
> > http://perl-begin.org/topics/cpan/ ,
> > so you can see how to install Perl modules from CPAN
On Thursday, December 15, 2011, Chris Stinemetz
wrote:
>
> It isn't a company policy just circumstance. The unix box I'm using
> doesn't support DNS nameserver lookup or a C compiler.
>
> I'm currently using Perl 5.6.1 which doesnt' support local::lib and I
> can't install perlbrew to upgrade my
split() splits on whitespace by default. so the "\s+/" is
optional.
$_ = "3 element array";
@words = split;
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
>
> However I think it's more likely that you need /all/ of the data to be
> output, so I suggest something like my program below.
>
> HTH,
>
> Rob
>
>
> use strict;
> use warnings;
>
> my @headers;
>
> while () {
> if (@headers) {
> my @data = split;
> for my $i (0 .. $#headers) {
> pr
On Fri, Dec 16, 2011 at 09:36:53PM -0600, Chris Stinemetz wrote:
> This program does all I need it to do. I am having some difficulty
> wrapping my head around it though. Mainly the for loop. Did Rob use
> special varible?
>
> If any one can explain it to me so I can have a better understanding
>
Nevermind. I used regex to accomplish what I wanted instead of the split
command. Thanks guys!
From: Danny H Wong mailto:dannw...@cisco.com>>
Date: Thursday, March 19, 2015 at 2:25 PM
To: Perl List mailto:beginners@perl.org>>, Perl Beginners
mailto:beginners@perl.org>>
Subject: split regex
Hi P
Hi Danny,
On Thu, 19 Mar 2015 21:42:53 +
"Danny Wong (dannwong)" wrote:
> Nevermind. I used regex to accomplish what I wanted instead of the split
> command. Thanks guys!
>
Just a note in general: sometimes when a simple split or a regex match fails
you may opt to employ more complex pars
Danny Wong:
Hello,
On Thu, Mar 19, 2015 at 09:25:02PM +, Danny Wong (dannwong) wrote:
> Hi Perl GURU, I have a string like this:
>
> 'Baseline: (_bMgvUBQ_EeKsP6DECdq0Lg) 1 "Initial Baseline"
> "Initial Baseline of Component NGP-Diagnostics" Sivakumar Subas
> Oct 12, 2012 12:35:41 AM';
>
> I
Umesh T G am Donnerstag, 15. Dezember 2005 13.00:
> Hi List,
Hi Umesh
> I want to get that value of *-i* set in below line.
>
> *Options=-a"hello" -mt -ml3 -i"dir1\dir2" -k -p -i"dir3\dir4" -m*
>
> What is the best way to get the value of *-i* values into one array. For
> ex: I want the output
Hi John,
I tried like this, where $line='*Options=-a"hello" -mt -ml3 -i"dir1\dir2"
-k -p -i"dir3\dir4" -m'*
if (grep/^Options/,$line)
{
@inc=split(/-i/,$line);
foreach $word (@inc)
{
print "$word\n";
}
I do not know how to proceed after this.
Thanks for your quick reply...
Thank
Umesh T G am Donnerstag, 15. Dezember 2005 14.20:
> Hi John,
Hi Umesh
> I tried like this, where $line='*Options=-a"hello" -mt -ml3 -i"dir1\dir2"
> -k -p -i"dir3\dir4" -m'*
>
>
>
> if (grep/^Options/,$line)
> {
>
> @inc=split(/-i/,$line);
>
> foreach $word (@inc)
> {
> print "$word\n";
> }
>
>
Hi Joe,
just to correct my prevoius one, my $line does not have * in the begining,
that was a type. the $line value is like this
*Options=-a"hello" -mt -ml3 -i"dir1\dir2"-k -p -i"dir3\dir4" -m*
my grep return the values correct to my array and the values in array will
be like this obviously:
Umesh T G wrote:
I tried like this, where $line='*Options=-a"hello" -mt -ml3 -i"dir1\dir2"
-k -p -i"dir3\dir4" -m'*
This line won't compile. Which of the following is it?
$line='Options=-a"hello" -mt -ml3 -i"dir1\dir2" -k -p -i"dir3\dir4" -m';
$line='*Options=-a"hello" -mt -ml3 -i"dir1\dir
Umesh T G wrote:
Hi Joe,
just to correct my prevoius one, my $line does not have * in the begining,
that was a type. the $line value is like this
*Options=-a"hello" -mt -ml3 -i"dir1\dir2"-k -p -i"dir3\dir4" -m*
my grep return the values correct to my array and the values in array will
be l
Umesh T G am Donnerstag, 15. Dezember 2005 15.31:
> Hi Joe,
>
> just to correct my prevoius one, my $line does not have * in the begining,
> that was a type. the $line value is like this
>
> *Options=-a"hello" -mt -ml3 -i"dir1\dir2"-k -p -i"dir3\dir4" -m*
>
>
>
> my grep return the values correct
Thanks Very much John. :) it worked, but a small problem. if I have "\"
after the directory name, it does not take as new instanance.
for ex:
if my $line is*Options=-a"hello" -mt -ml3 -i"dir1\dir2"-k -p
-i"dir3\dir4\" -m -n -i"\dir5\dir6" -k*
**
then, I'm getting output like this,
dir1\dir
Sorry for that John. It works fine.
Many thanks for your help.
Umesh
On 12/16/05, Umesh T G <[EMAIL PROTECTED]> wrote:
>
> Thanks Very much John. :) it worked, but a small problem. if I have
> "\" after the directory name, it does not take as new instanance.
> for ex:
> if my $line is*
Hi Brent,
The split() is wonderful for doing what you want.
-Anne
This one time, Brent Clark wrote:
> Hi all
>
> I have a string like so
>
> 01.01.04
>
> I need to split and add it to an array
>
> my method of
>
> ($abc) = $test =~ /\./g;
>
> does not seem to provide me with a satisfying
On 4/7/06, Brent Clark <[EMAIL PROTECTED]> wrote:
> I have a string like so
>
> 01.01.04
>
> I need to split and add it to an array
Split, huh? Have you tried using the split() operator? It's covered in
the perlfunc manpage.
But if you're dealing with date-and-time data, you may really be
lookin
On Fri, 2006-07-04 at 17:38 +0200, Brent Clark wrote:
> Hi all
>
> I have a string like so
>
> 01.01.04
>
> I need to split and add it to an array
>
> my method of
>
> ($abc) = $test =~ /\./g;
>
> does not seem to provide me with a satisfying result
>
> and I get back is the period.
>
> If
> Hi,
>
> To run/use Split function in the perl script , is it necessary to
> include/add any perl module ?
No no need. It is a built in function.
perldoc -f split
--
Regards,
Edward WIJAYAA
Institute For Infocomm Research - Disclaimer -
This email is confidenti
- Original Message -
From: ""Saurabh Singhvi"" <[EMAIL PROTECTED]>
Newsgroups: perl.beginners
To: "Perl FAq"
Sent: Thursday, May 25, 2006 3:38 PM
Subject: split doubt
Hi
the format of split() defines that one
can split a string into a fixed number
of specifies strings. for eg
($lo
On Thu, 2006-05-25 at 19:38 +, Saurabh Singhvi wrote:
> Hi
>
> the format of split() defines that one
> can split a string into a fixed number
> of specifies strings. for eg
>
> ($login, $passwd, $remainder) = split(/:/, $_, 3);
>
> Now, the thing is, it splits on first 3 parts.
> Can i do t
On Thu, 2006-25-05 at 13:17 -0700, Joshua Colson wrote:
> On Thu, 2006-05-25 at 19:38 +, Saurabh Singhvi wrote:
> > Hi
> >
> > the format of split() defines that one
> > can split a string into a fixed number
> > of specifies strings. for eg
> >
> > ($login, $passwd, $remainder) = split(/:/,
Saurabh Singhvi wrote:
> Hi
Hello,
> the format of split() defines that one
> can split a string into a fixed number
> of specifies strings. for eg
>
> ($login, $passwd, $remainder) = split(/:/, $_, 3);
>
> Now, the thing is, it splits on first 3 parts.
> Can i do the reverse?? as in instead of
On Jul 19, 2006, at 9:57, Sayed, Irfan ((Irfan)) wrote:
I need to split following string
cs_backup_restore_cmvobsvr1mum
the output which i am looking for is
cs_backup_restore and _cmvobsvr1mum
Which is the criteria, everything up to the last underscore?
-- fxn
--
To unsubscribe, e-mail
-Original Message-
From: Xavier Noria [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 19, 2006 1:33 PM
To: Perl Beginners
Subject: Re: split function
On Jul 19, 2006, at 9:57, Sayed, Irfan ((Irfan)) wrote:
> I need to split following string
>
> cs_backup_restore_cmvobsvr1mu
On Jul 19, 2006, at 10:05, Sayed, Irfan ((Irfan)) wrote:
I think criteria shud be _ but I need output in following manner
That criteria is ambiguous becasue there are several _s and you need
to deal with them differently, that is, ignoring some and splitting
on some. Can you be more specif
x27;cs_backup_restore_cmvobsvr1mum'; my @arr=
($str=~/(.+)_(.+)/); print join "\n",@arr,"\n";'
cs_backup_restore
cmvobsvr1mum
Ajay>
Thanks,
Ajay
-Original Message-
From: Xavier Noria [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 19, 2006 1:33 PM
To: Perl Begi
"Sayed, Irfan (Irfan)" schreef:
> I need to split following string
>
> cs_backup_restore_cmvobsvr1mum
>
> the output which i am looking for is
>
> cs_backup_restore and _cmvobsvr1mum
$ perl -Mstrict -wle '
$_ = "cs_backup_restore_cmvobsvr1mum" ;
@_ = split /(_)/ ;
# print for @_ ;
$" = "\t"
On 07/19/2006 02:57 AM, Sayed, Irfan (Irfan) wrote:
Hi,
I need to split following string
cs_backup_restore_cmvobsvr1mum
the output which i am looking for is
cs_backup_restore and _cmvobsvr1mum
can anybody plz help
regards
irfan.
Sayed, Irfan; your questions are too basic. Any
econd: _cmvobsvr1mum
Regards,
Prasad
""Sayed, Irfan (Irfan)"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
..
-Original Message-
From: Xavier Noria [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 19, 2006 1:33 PM
To: Perl Beginners
Subject: Re: split fu
It may have something to do with what shell you are running under.
I ran it under a korn shell(MKS) w2k and id one at 1590 characters and had
no problem. From some other emails I have seen, the shell may allow only so
much to happen.
What are you running under?
Wags ;)
-Orig
Hi Shawn
I'll stick my neck out and say that this is a bug in Perl, to do with
Unicode support. Running the loop from 0..256 gives you 256 8-bit characters
and one 16-bit character (0x0100 = 256). This seems to upset split() as it
stands. Try adding:
use bytes;
at the start of your code, and
The original posted perl line worked fine on my RH8.0 box.
~$ perl -e 'for(0..256) { $s.=chr($_) } for(split(//,$s)) { print }'
123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øù
Thanks for the reponses,
See below:
- Original Message -
From: "Wiggins d'Anconia" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, December 28, 2002 3:28 PM
Subject: Re: split error
> The original posted perl line worked fine on my RH8.0 b
[snip]
> On FreeBSD, I get:
>
> % perl -e 'use bytes; for(0..256) { $s.=chr($_) } for(split(//,$s)) { print }'
>
>
>
>
>!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ
>
>¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍ
Perl wrote:
>
> Hi,
Hello,
>i am new to Perl.
>here is my question
>
> i have a character string like abc#def#ghi#jkl
>
> i want to split the string based on the delimiter # so that i get
> something like this :
>
> abc def ghi jkl
>
> But
>
> @temp = split(/#/, "ab
On Sat, Dec 13, 2003 at 09:16:35PM -0800, Perl wrote:
> Hi,
>i am new to Perl.
>here is my question
>
> i have a character string like abc#def#ghi#jkl
>
> i want to split the string based on the delimiter # so that i get
> something like this :
>
> abc def ghi jkl
>
> Bu
Try this:
@temp = split('\#', "abc#def#ghi#jkl") ;
foreach (@temp){
print "\n", $_;
}
Josimar
- Original Message -
From: "Perl" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 14, 2003 3:16 AM
Subject: Split question
> Hi,
>i am new to Perl.
>here is my que
Josimar Nunes De Oliveira wrote:
>
> From: "Perl" <[EMAIL PROTECTED]>
> >
> > @temp = split(/#/, "abc#def#ghi#jkl") ;
> >
> > doesn't seem to work.
> >
> > am i doing anything wrong here ?
>
> Try this:
>
> @temp = split('\#', "abc#def#ghi#jkl") ;
> foreach (@temp){
> print "\n", $_;
> }
The
On Sun, 2003-12-14 at 14:52, John W. Krahn wrote:
> Josimar Nunes De Oliveira wrote:
> >
> > From: "Perl" <[EMAIL PROTECTED]>
> > >
> > > @temp = split(/#/, "abc#def#ghi#jkl") ;
> > >
> > > doesn't seem to work.
> > >
> > > am i doing anything wrong here ?
> >
> > Try this:
> >
> > @temp = spl
Joel Newkirk wrote:
> > The first argument to split is converted to a regular expression and the
> > '#' character is not special in a regular expression so split/#/ and
> > split'\#' do exactly the same thing.
>
> Well, actually they don't, since the 'bare' # will be interpreted as
> starting a c
Joel Newkirk wrote:
>
> On Sun, 2003-12-14 at 14:52, John W. Krahn wrote:
> > Josimar Nunes De Oliveira wrote:
> > >
> > > From: "Perl" <[EMAIL PROTECTED]>
> > > >
> > > > @temp = split(/#/, "abc#def#ghi#jkl") ;
> > >
> > > @temp = split('\#', "abc#def#ghi#jkl") ;
> >
> > The first argument to s
On Dec 14, 2003, at 6:42 PM, R. Joseph Newton wrote:
The only problem I see with John's code is that it addumes that
the print statement will print a newline, which it doesn't [at least
on my
installation of V5.8].
Na, John's smarter than you give him credit for here. Here was the
code:
On Dec
"R. Joseph Newton" wrote:
>
> Joel Newkirk wrote:
>
> > Well, actually they don't, since the 'bare' # will be interpreted as
> > starting a comment, while the one in quotes won't... ;^)
> >
> > The op's assignment was assigning 'split(/' to @temp...
>
> Did you test.
Did YOU test?
> The only
On Sun, 2003-12-14 at 18:11, Joel Newkirk wrote:
> >
> > The first argument to split is converted to a regular expression and the
> > '#' character is not special in a regular expression so split/#/ and
> > split'\#' do exactly the same thing.
>
> Well, actually they don't, since the 'bare' # wi
"John W. Krahn" wrote:
> "R. Joseph Newton" wrote:
> >
> > Joel Newkirk wrote:
> >
> > > Well, actually they don't, since the 'bare' # will be interpreted as
> > > starting a comment, while the one in quotes won't... ;^)
> > >
> > > The op's assignment was assigning 'split(/' to @temp...
> >
> >
On Monday, December 15, 2003 03:05, John W. Krahn wrote:
>Here is a little quiz for you beginners out there. split() treats its
>first argument as a regular expression. There are TWO exceptions where
>the first argument does not behave the same as a normal regular
>expression. What are they?
T
> On Monday, December 15, 2003 03:05, John W. Krahn wrote:
>
> >Here is a little quiz for you beginners out there. split() treats its
> >first argument as a regular expression. There are TWO exceptions where
> >the first argument does not behave the same as a normal regular
> >expression. Wha
Wiggins d Anconia <[EMAIL PROTECTED]> wrote:
:
: > On Monday, December 15, 2003 03:05, John W. Krahn wrote:
: >
: > > Here is a little quiz for you *BEGINNERS* out there.
[emphasis added]
:
: But parentheses are normal in a regex, though granted the
: return is odd. I would guess as the second
John wrote:
>
> Here is a little quiz for you beginners out there. split() treats its
> first argument as a regular expression. There are TWO exceptions where
> the first argument does not behave the same as a normal regular
> expression. What are they?
I know! Please sir!
Actually this 'backw
Hi,
Somethig like this should work (untested):
my ( $name, $info ) = split /\(/, $data;
regards, Aim.
[EMAIL PROTECTED] wrote:
> I'm having a problem splitting a variable and need some help. What I have is
> some variables with a na
Jimstone7 wrote at Thu, 27 Mar 2003 06:39:25 -0500:
> $data = "David (man from uncle)";
>
> $data = "John Doe (The boy down the hall)";
>
> What I want to do is split $data into two string variables, one holding the
> $name, and the other holding all the $info that is within the parens. How
Janek Schleicher wrote:
> Jimstone7 wrote at Thu, 27 Mar 2003 06:39:25 -0500:
>
> > $data = "David (man from uncle)";
> >
> > $data = "John Doe (The boy down the hall)";
> >
> > What I want to do is split $data into two string variables, one holding the
> > $name, and the other holding all the
Janek Schleicher wrote:
>
> Jimstone7 wrote at Thu, 27 Mar 2003 06:39:25 -0500:
>
> > $data = "David (man from uncle)";
> >
> > $data = "John Doe (The boy down the hall)";
> >
> > What I want to do is split $data into two string variables, one holding the
> > $name, and the other holding all
Stefan Lidman wrote at Thu, 27 Mar 2003 13:55:27 +0100:
> Janek Schleicher wrote:
>> I would use a regexp:
>>
>> my ($name, $info) = $data =~ /(.*?)\w+\((.*)\)/;
>
> I guess you ment:
> my ($name, $info) = $data =~ /(.*?)\s*\((.*)\)/;
Yep.
Cheerio,
Janek
--
To unsubscribe, e-mail: [EMAIL PR
Rob Dixon wrote at Thu, 27 Mar 2003 12:51:46 +:
> Janek Schleicher wrote:
>> > $data = "David (man from uncle)";
>> >
>> > $data = "John Doe (The boy down the hall)";
>> >
>> > What I want to do is split $data into two string variables, one holding the
>> > $name, and the other holding all
Janek Schleicher wrote:
> Rob Dixon wrote at Thu, 27 Mar 2003 12:51:46 +:
>
> >
> > I'm afraid your regex is wrong! It does the following:
>
> Yep, it was a typo and untested.
>
> > capture zero or more (as few as possible) of any character
> > !! match one or more 'word' characters follow
Pablo Fischer wrote:
>
> Hi!
Hello,
> I have a string (its an array, the array has the values that $ftp->ls("dir)
> returns), so $array[1] contains this:
> -rw-r--r-- 1 pablopablo 18944 Jul 16 21:14 File28903.zip
>
> What I would like to do is: get the date (Jul 16), the time (12:14
Pablo Fischer wrote at Fri, 25 Jul 2003 13:49:55 +:
> I have a string (its an array, the array has the values that $ftp->ls("dir)
> returns), so $array[1] contains this:
> -rw-r--r-- 1 pablopablo 18944 Jul 16 21:14 File28903.zip
>
> What I would like to do is: get the date (Jul 1
Like this...
$string="1
blabla";
my @lines = split("\n", $string);
# testing...
print "1: $lines[0]\n";
print "2: $lines[1]\n";
See perldoc -f split if you want more info on the command.
Rob
-Original Message-
From: Pablo Fischer [mailto:[EMAIL PROTECTED]
Sent: Monday, August 18, 2003
>
> $string="1
> blabla";
>
> When Im printing $string I get a new line between 1 and blabla, now I
needt o
> split that.. in
>
> my($number, $real_string) = split...
my($number, $real_string) = split /\n/, $string;
HTH
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-m
> What's the problem with my split?
>
> $line = "var=value";
> ($var, $value) = split(/\s*[=]\s*/, $line);
Looks fine to me.
> I experienced that $var and $value contained the first letter of the
var and
> the value. Sometimes nothing. Where is the error?
Looks to me like it must be in
On 8/5/01 9:39 PM, Romek Krisztián wrote:
> Hello!
>
> What's the problem with my split?
>
> $line = "var=value";
> ($var, $value) = split(/\s*[=]\s*/, $line);
>
> Krisztian
>
> I experienced that $var and $value contained the first letter of the var and
> the value. Sometimes nothin
Hi Romek,
Try with
\s*=\s*
Naren.
Romek Krisztián wrote:
> Hello!
>
> What's the problem with my split?
>
> $line = "var=value";
> ($var, $value) = split(/\s*[=]\s*/, $line);
>
> Krisztian
>
> I experienced that $var and $value contained the first letter of the var and
> the value. Som
Scott,
The problem is that | is a pattern metacharacter, and still needs to be
escaped.
try:
my @arr = split(/\Q$CharSep/, $_);
#
I have a delimited text file with a vertical bar (|) as the column
delimiter. When I execute the following statement
On Aug 13, Scott and Kristin Seitz said:
>$CharSep="\|";
The double quoted string "\|" is still just "|".
Use single quotes or the quotemeta() function.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http:/
On Wednesday, May 1, 2002, at 02:47 , Greg D. wrote:
> Hi,
>
> Is there any way i can split an array that contains information that i got
> from the mysql database?
>
> here's the code:
>
> while(my @data = $sth->fetchrow_array){
> print "@data\n";
what does
print "$_\n" forea
On Wednesday, May 1, 2002, at 02:55 PM, drieux wrote:
>
> On Wednesday, May 1, 2002, at 02:47 , Greg D. wrote:
>
>> Hi,
>>
>> Is there any way i can split an array that contains information that i
>> got
>> from the mysql database?
>>
>> here's the code:
>>
>> while(my @data = $sth->fetchrow_a
On Wednesday, May 1, 2002, at 03:04 , bob ackerman wrote:
> On Wednesday, May 1, 2002, at 02:55 PM, drieux wrote:
>> On Wednesday, May 1, 2002, at 02:47 , Greg D. wrote:
>>> here's the code:
>>>
>>> while(my @data = $sth->fetchrow_array){
>>> print "@data\n";
>>
>> what does
>>
>>
On Wed, 2002-05-01 at 17:47, Greg D. wrote:
> Hi,
>
> Is there any way i can split an array that contains information that i got
> from the mysql database?
>
> here's the code:
>
> while(my @data = $sth->fetchrow_array){
> print "@data\n";
>
> right now its prints out for example:
>
Hello Greg
This is a simple method that may work.
while ( my @data= $cursor->fetchrow_array ) {
$idnum = $row[0];
$username = $row[1];
$email = $row[2];
$code= $row[3];
print "$idnum $username $email $code ";
}
"Greg D ." <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[E
On Wed, 2002-05-01 at 18:43, Ron wrote:
> Hello Greg
>
> This is a simple method that may work.
>
> while ( my @data= $cursor->fetchrow_array ) {
> $idnum = $row[0];
> $username = $row[1];
> $email = $row[2];
> $code= $row[3];
>
> print "$idnum $username $email $code ";
> }
>
> "Greg
On Wednesday, May 1, 2002, at 03:43 PM, Ron wrote:
> Hello Greg
>
> This is a simple method that may work.
>
> while ( my @data= $cursor->fetchrow_array ) {
> $idnum = $row[0];
> $username = $row[1];
> $email = $row[2];
> $code= $row[3];
>
> print "$idnum $username $email $code ";
> }
Oops. As you stated, @row is suppose to be @data. I did assume that the
display was in HTML. I guess it's an occupational hazard doing web
development.
Ron
"Chas Owens" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Wed, 2002-05-01 at 18:43, Ron wrote:
> H
On Wednesday, May 1, 2002, at 02:47 , Greg D. wrote:
> while(my @data = $sth->fetchrow_array){
> print "@data\n";
>
> right now its prints out for example:
>
> 1 greg [EMAIL PROTECTED] 1234 2 john [EMAIL PROTECTED] 4r434 and so on
>
> i want it so it prints out..
>
> 1 greg [EMAIL PR
I like Rons method best, except you could use this
instead ov array slot values, which I am not sure will
work...
while ( my @data= $cursor->fetchrow_hashref ) {
$idnum = $data->{'idnum'};
$username = $data-.{'username'};
$email = $data->{'email'};
$code = $data->{'c
>
> Hi!
>
> Can the perl split function split a random 40 character string into
five 8 character strings?
>
> With random I mean that there is no special pattern in the 40
character string that can be used as split markers.
>
This smells like homework? (just a reminder to the gurus, it is t
C r wrote:
Can the perl split function split a random 40 character string into
five 8 character strings?
With random I mean that there is no special pattern in the 40
character string that can be used as split markers.
Don't know, but in any case the m// operator is a better way to do that:
my
On Tue, 14 Sep 2004, c r wrote:
> Can the perl split function split a random 40 character string into
> five 8 character strings?
>
> With random I mean that there is no special pattern in the 40
> character string that can be used as split markers.
Wouldn't substr make more sense, or a regex?
> Can the perl split function split a random 40 character
> string into five 8 character strings?
>
> With random I mean that there is no special pattern in the 40
> character string that can be used as split markers.
How about unpack?
@eights = unpack("A8" x (length($string)/8), $string);
c r wrote:
Hi!
Hello,
Can the perl split function split a random 40 character string into five 8 character strings?
No.
With random I mean that there is no special pattern in the 40 character string that can be used as split markers.
You should probably use a match operator.
my @strings = $string =
On 10/12/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> One of the column in csv file is Fri, Oct 12 10:32 AM. I am trying ti split
> the csv file for checking a column value. when spliting I wanted to take Fri,
> Oct 12 10:32 AM as a single value. How can I use split?
>
> Thanks
> Manoj
If
On 10/12/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> One of the column in csv file is Fri, Oct 12 10:32 AM. I am trying ti split
> the csv file for checking a column value. when spliting I wanted to take
> Fri, Oct 12 10:32 AM as a single value. How can I use split?
You don't want split fo
There's a comma in the example data provided. Most of the CSV's I've
dealt with also quote values which were strings. If this is the case,
an ugly solution would be to use something along the lines of '","' as
the delimiter, take into account any possible fields which aren't quoted
(it should be
try
chomp(my @strm = split(/\s+/, $IntegrationStream));
as your only splitting on 1 space where 2 are present in your string.
-Original Message-
From: Sayed, Irfan (Irfan) [mailto:[EMAIL PROTECTED]
Sent: 30 October 2007 09:38
To: beginners @ perl. org
Subject: Split function
Hi All,
On Oct 30, 5:37 am, [EMAIL PROTECTED] (Irfan Sayed) wrote:
> Hi All,
>
> I have one variable which stores the value as follows.
>
> "2007-09-07T12:50:26+05:30 aic_8.0_Integration ccvob01" Now my
> requirement is that I want to store aic_8.0_Integration part of the
> string in different variable.
Paul Lalli wrote:
Annoyingly, split / /, $foo; and split ' ', $foo; are not the same
thing. split ' ', $foo is a special case that means to split on all
sequences of whitespace. It means the same thing as split /\s+/,
$foo;
Not quite Paul. From perldoc -f split:
A "split" on "/\s+/" is li
On Oct 30, 1:30 pm, [EMAIL PROTECTED] (Rob Dixon) wrote:
> Paul Lalli wrote:
> > Annoyingly, split / /, $foo; and split ' ', $foo; are not the same
> > thing. split ' ', $foo is a special case that means to split on all
> > sequences of whitespace. It means the same thing as split /\s+/,
> > $foo
Andrew Curry schreef:
> split(/\s+/, ...
Most of the times you think you need /\s+/ with split, you actually want
q{ }.
See `perldoc -f split`.
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://lear
On May 31, Pedro A Reche Gallardo said:
>How can I split a string of caracters -any but blank spaces- into
>the individual caracters?
So you want to split "what's up, doc?" into
@chars = qw( w h a t ' s u p , d o c ? );
That is, every character except spaces?
First, remove spaces from t
> How can I split a string of caracters -any but blank spaces- into
> the individual caracters?
Try something like this:
my @arr = split //, "sometext";
foreach $i (@arr) {
print "$i\n";
}
-- Brett
Brett W. McCoy
Software Engineer
Broadsoft, Inc.
240-364-5225
[EMAIL PROTECTED]
> "Pedro" == Pedro A Reche Gallardo <[EMAIL PROTECTED]> writes:
Pedro> How can I split a string of caracters -any but blank spaces- into
Pedro> the individual caracters?
my @chars = $string =~ /\S/g;
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL
--- Pedro A Reche Gallardo <[EMAIL PROTECTED]> wrote:
> Hi all,
> How can I split a string of caracters -any but blank spaces- into
> the individual caracters?
> Cheers
I'd say
@chars = split /\s*/, $string;
That will split between characters that have any number of spaces
between them -
--- "Randal L. Schwartz" <[EMAIL PROTECTED]> wrote:
> > "Pedro" == Pedro A Reche Gallardo
> <[EMAIL PROTECTED]> writes:
>
> Pedro> How can I split a string of caracters -any but blank spaces-
> into
> Pedro> the individual caracters?
>
> my @chars = $string =~ /\S/g;
I've seen a couple
On May 31, Paul said:
>> my @chars = $string =~ /\S/g;
>
>I've seen a couple of people doing this, and maybe I'm just confused,
>but
>
>Isn't the point of the original request to split into the original
>characters, but leave *out* the spaces?
>
>and isn't \S any nonspace?
>
>So, if you split
--- Jeff Pinyan <[EMAIL PROTECTED]> wrote:
> On May 31, Paul said:
>
> >> my @chars = $string =~ /\S/g;
> >
> >I've seen a couple of people doing this, and maybe I'm just
> confused,
> >but
> >
> >Isn't the point of the original request to split into the original
> >characters, but leave *ou
101 - 200 of 438 matches
Mail list logo