Re: [solved] parsing and adding back this string

2011-09-04 Thread Shlomi Fish
Hi Rajeev, On Sun, 4 Sep 2011 08:05:52 -0700 (PDT) Rajeev Prasad wrote: > Shlomi Fish, > > this is not complete code but part of it, '...' in top and bottom denote > that, strict warning etc is used. Well, first of all, it would be a good idea to include the complete code. Using "..." to denot

Re: [solved] parsing and adding back this string

2011-09-04 Thread Rajeev Prasad
s suggested the same. From: Shlomi Fish To: Rajeev Prasad Cc: Perl Beginners Sent: Sunday, September 4, 2011 1:25 AM Subject: Re: [solved] parsing and adding back this string Hi Rajeev, please acknowledge you have received and read this message. On Sat, 3 Sep 2011

Re: [solved] parsing and adding back this string

2011-09-04 Thread John W. Krahn
Rajeev Prasad wrote: $k=1; my $arSZ = @tmpAR=split(/"/,$line); for $x (0..$arSZ-1){ if ($x % 2 == 0) { push(@modline,"$tmpAR[$x]"); } else { my $count = $tmpAR[$x-1] =~ tr/,/,/;#try for something more correct like... =~ m/\,/g); $k = $k + $count; pus

Re: [solved] parsing and adding back this string

2011-09-03 Thread Shlomi Fish
Hi Rajeev, please acknowledge you have received and read this message. On Sat, 3 Sep 2011 15:47:42 -0700 (PDT) Rajeev Prasad wrote: > ... > ... > > $k=1; > my $arSZ = @tmpAR=split(/"/,$line); >     for $x (0..$arSZ-1){ >     if ($x % 2 == 0) { >     push(@modline,"$tmpAR[$x]"); > >     } else

Re: [solved] parsing and adding back this string

2011-09-03 Thread Rajeev Prasad
line,"STRING.$k");     } print @modline; ... ... this replaces fields in quotes with STRING-field number. From: Rajeev Prasad To: Perl Beginners Sent: Saturday, September 3, 2011 10:34 AM Subject: Re: parsing and adding back this string   comma

Re: parsing and adding back this string

2011-09-03 Thread Rajeev Prasad
er. From: Rob Dixon To: Perl Beginners Cc: Rajeev Prasad Sent: Saturday, September 3, 2011 4:13 AM Subject: Re: parsing and adding back this string On 02/09/2011 23:33, Rajeev Prasad wrote: > friends, > > I am now trying to parse this string in this way... > > x= could be a

Re: parsing and adding back this string

2011-09-03 Thread Rob Dixon
On 02/09/2011 23:33, Rajeev Prasad wrote: friends, I am now trying to parse this string in this way... x= could be anything including special character string = xx:ABC,xx,x,x,x,"x,x,x",x,x,x,"x,x",x string0=ABC string2="x,x,x" string3="x,x" string1=xx:string0,tt,x,x,x,string2,x,x,x,string3,x

Re: parsing and adding back this string

2011-09-02 Thread Brandon McCaig
On Fri, Sep 2, 2011 at 6:54 PM, Rob Dixon wrote: > I'm afraid your post doesn't make very much sense to me, and doesn't > contain a question. Can you give an example showing what you want from > some real data? Agreed. As you describe, "x" can be anything, yet your sample is full of x's all over

Re: parsing and adding back this string

2011-09-02 Thread Rob Dixon
On 02/09/2011 23:33, Rajeev Prasad wrote: friends, I am now trying to parse this string in this way... x= could be anything including special character string = xx:ABC,xx,x,x,x,"x,x,x",x,x,x,"x,x",x string0=ABC string2="x,x,x" string3="x,x" string1=xx:string0,tt,x,x,x,string2,x,x,x,string3,x

parsing and adding back this string

2011-09-02 Thread Rajeev Prasad
friends,   I am now trying to parse this string in this way...   x= could be anything including special character   string = xx:ABC,xx,x,x,x,"x,x,x",x,x,x,"x,x",x   string0=ABC string2="x,x,x" string3="x,x" string1=xx:string0,tt,x,x,x,string2,x,x,x,string3,x   final string is string1