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