Gurunath, This is an ideal situation to use map. Thats the more perlish way<br><br><div class="gmail_quote">On Sun, Apr 17, 2011 at 12:30 AM,  <span dir="ltr"><<a href="mailto:bangalore-pm-request@pm.org">bangalore-pm-request@pm.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Send Bangalore-pm mailing list submissions to<br>
        <a href="mailto:bangalore-pm@pm.org">bangalore-pm@pm.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://mail.pm.org/mailman/listinfo/bangalore-pm" target="_blank">http://mail.pm.org/mailman/listinfo/bangalore-pm</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:bangalore-pm-request@pm.org">bangalore-pm-request@pm.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:bangalore-pm-owner@pm.org">bangalore-pm-owner@pm.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of Bangalore-pm digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. help in scripting (Gurunath Katagi)<br>
   2. Re: help in scripting (Jagadeesh N. Malakannavar)<br>
   3. Re: help in scripting (Gurunath Katagi)<br>
   4. Re: help in scripting (Jagadeesh N. Malakannavar)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Sat, 16 Apr 2011 11:03:59 +0530<br>
From: Gurunath Katagi <<a href="mailto:gurunath.katagi@gmail.com">gurunath.katagi@gmail.com</a>><br>
To: <a href="mailto:bangalore-pm@pm.org">bangalore-pm@pm.org</a><br>
Subject: [Bangalore-pm] help in scripting<br>
Message-ID: <BANLkTi=<a href="mailto:ipgTajULJOsq7UGCNa%2BguQttMDQ@mail.gmail.com">ipgTajULJOsq7UGCNa+guQttMDQ@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
hi .. i am new to perl ..<br>
i have a input file something pasted as below ..<br>
<br>
16 50<br>
16 30<br>
16 23<br>
17 88<br>
17 99<br>
18 89<br>
18 1<br>
..<br>
--<br>
<br>
and i want the output something like this :<br>
16 50 30 23<br>
17 88 99<br>
18 99 1<br>
<br>
i.e for each values in the first column, i want the elements in the second<br>
column to be a one row ..<br>
<br>
can be anybody give me psuedocode , to how to go about this ..<br>
thank you<br>
<br>
gurunath<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mail.pm.org/pipermail/bangalore-pm/attachments/20110416/83e60b7a/attachment-0001.html" target="_blank">http://mail.pm.org/pipermail/bangalore-pm/attachments/20110416/83e60b7a/attachment-0001.html</a>><br>

<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Sat, 16 Apr 2011 11:19:23 +0530<br>
From: "Jagadeesh N. Malakannavar" <<a href="mailto:mnjagadeesh@gmail.com">mnjagadeesh@gmail.com</a>><br>
To: Gurunath Katagi <<a href="mailto:gurunath.katagi@gmail.com">gurunath.katagi@gmail.com</a>><br>
Cc: <a href="mailto:bangalore-pm@pm.org">bangalore-pm@pm.org</a><br>
Subject: Re: [Bangalore-pm] help in scripting<br>
Message-ID: <<a href="mailto:BANLkTimR6ohd4j3bdiVBCgXRgzU3Xy8eFA@mail.gmail.com">BANLkTimR6ohd4j3bdiVBCgXRgzU3Xy8eFA@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Here is the sample script . hope this helps you<br>
<br>
use strict;<br>
use warnings;<br>
<br>
my $str =<<EOF;<br>
16 50<br>
16 30<br>
16 23<br>
17 88<br>
17 99<br>
18 89<br>
18 1<br>
EOF<br>
<br>
my $DATA;<br>
<br>
while ($str =~ m/\G((\d+)\s+(\d+)\n)/gc) {<br>
    push @{$DATA->{$2}}, $3;<br>
}<br>
<br>
foreach my $num (sort keys %$DATA) {<br>
    print "\n$num ", join (' ', @{$DATA->{$num}});<br>
}<br>
<br>
<br>
----<br>
Thanks<br>
Jagadeesh N.Malakannavar<br>
9448471968<br>
<br>
2011/4/16 Gurunath Katagi <<a href="mailto:gurunath.katagi@gmail.com">gurunath.katagi@gmail.com</a>><br>
<br>
> hi .. i am new to perl ..<br>
> i have a input file something pasted as below ..<br>
><br>
> 16 50<br>
> 16 30<br>
> 16 23<br>
> 17 88<br>
> 17 99<br>
> 18 89<br>
> 18 1<br>
> ..<br>
> --<br>
><br>
> and i want the output something like this :<br>
> 16 50 30 23<br>
> 17 88 99<br>
> 18 99 1<br>
><br>
> i.e for each values in the first column, i want the elements in the second<br>
> column to be a one row ..<br>
><br>
> can be anybody give me psuedocode , to how to go about this ..<br>
> thank you<br>
><br>
> gurunath<br>
><br>
> _______________________________________________<br>
> Bangalore-pm mailing list<br>
> <a href="mailto:Bangalore-pm@pm.org">Bangalore-pm@pm.org</a><br>
> <a href="http://mail.pm.org/mailman/listinfo/bangalore-pm" target="_blank">http://mail.pm.org/mailman/listinfo/bangalore-pm</a><br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mail.pm.org/pipermail/bangalore-pm/attachments/20110416/66563870/attachment-0001.html" target="_blank">http://mail.pm.org/pipermail/bangalore-pm/attachments/20110416/66563870/attachment-0001.html</a>><br>

<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Sat, 16 Apr 2011 12:13:58 +0530<br>
From: Gurunath Katagi <<a href="mailto:gurunath.katagi@gmail.com">gurunath.katagi@gmail.com</a>><br>
To: "Jagadeesh N. Malakannavar" <<a href="mailto:mnjagadeesh@gmail.com">mnjagadeesh@gmail.com</a>><br>
Cc: <a href="mailto:bangalore-pm@pm.org">bangalore-pm@pm.org</a><br>
Subject: Re: [Bangalore-pm] help in scripting<br>
Message-ID: <BANLkTikd=<a href="mailto:gdYrWUFzBb_WuhfMrLyuVQPuw@mail.gmail.com">gdYrWUFzBb_WuhfMrLyuVQPuw@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
hi ..<br>
how r u reading the a list of values into a scalar ..<br>
when i tried this, its taking only one value ..<br>
please find the input file attached ..<br>
  and kindly reply ..<br>
<br>
Thank you<br>
gurunath<br>
<br>
<br>
On Sat, Apr 16, 2011 at 11:19 AM, Jagadeesh N. Malakannavar <<br>
<a href="mailto:mnjagadeesh@gmail.com">mnjagadeesh@gmail.com</a>> wrote:<br>
<br>
> Here is the sample script . hope this helps you<br>
><br>
> use strict;<br>
> use warnings;<br>
><br>
> my $str =<<EOF;<br>
> 16 50<br>
> 16 30<br>
> 16 23<br>
> 17 88<br>
> 17 99<br>
> 18 89<br>
> 18 1<br>
> EOF<br>
><br>
> my $DATA;<br>
><br>
> while ($str =~ m/\G((\d+)\s+(\d+)\n)/gc) {<br>
>     push @{$DATA->{$2}}, $3;<br>
> }<br>
><br>
> foreach my $num (sort keys %$DATA) {<br>
>     print "\n$num ", join (' ', @{$DATA->{$num}});<br>
> }<br>
><br>
><br>
> ----<br>
> Thanks<br>
> Jagadeesh N.Malakannavar<br>
> 9448471968<br>
><br>
> 2011/4/16 Gurunath Katagi <<a href="mailto:gurunath.katagi@gmail.com">gurunath.katagi@gmail.com</a>><br>
><br>
>> hi .. i am new to perl ..<br>
>> i have a input file something pasted as below ..<br>
>><br>
>> 16 50<br>
>> 16 30<br>
>> 16 23<br>
>> 17 88<br>
>> 17 99<br>
>> 18 89<br>
>> 18 1<br>
>> ..<br>
>> --<br>
>><br>
>> and i want the output something like this :<br>
>> 16 50 30 23<br>
>> 17 88 99<br>
>> 18 99 1<br>
>><br>
>> i.e for each values in the first column, i want the elements in the second<br>
>> column to be a one row ..<br>
>><br>
>> can be anybody give me psuedocode , to how to go about this ..<br>
>> thank you<br>
>><br>
>> gurunath<br>
>><br>
>> _______________________________________________<br>
>> Bangalore-pm mailing list<br>
>> <a href="mailto:Bangalore-pm@pm.org">Bangalore-pm@pm.org</a><br>
>> <a href="http://mail.pm.org/mailman/listinfo/bangalore-pm" target="_blank">http://mail.pm.org/mailman/listinfo/bangalore-pm</a><br>
>><br>
><br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mail.pm.org/pipermail/bangalore-pm/attachments/20110416/f7fe35cc/attachment-0001.html" target="_blank">http://mail.pm.org/pipermail/bangalore-pm/attachments/20110416/f7fe35cc/attachment-0001.html</a>><br>

-------------- next part --------------<br>
A non-text attachment was scrubbed...<br>
Name: tr1.dat<br>
Type: application/x-ns-proxy-autoconfig<br>
Size: 493 bytes<br>
Desc: not available<br>
URL: <<a href="http://mail.pm.org/pipermail/bangalore-pm/attachments/20110416/f7fe35cc/attachment-0001.bin" target="_blank">http://mail.pm.org/pipermail/bangalore-pm/attachments/20110416/f7fe35cc/attachment-0001.bin</a>><br>

<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Sat, 16 Apr 2011 13:34:02 +0530<br>
From: "Jagadeesh N. Malakannavar" <<a href="mailto:mnjagadeesh@gmail.com">mnjagadeesh@gmail.com</a>><br>
To: Gurunath Katagi <<a href="mailto:gurunath.katagi@gmail.com">gurunath.katagi@gmail.com</a>><br>
Cc: <a href="mailto:bangalore-pm@pm.org">bangalore-pm@pm.org</a><br>
Subject: Re: [Bangalore-pm] help in scripting<br>
Message-ID: <<a href="mailto:BANLkTik1TyNXYMBhVRLgj7wwM78kQCQ6Tg@mail.gmail.com">BANLkTik1TyNXYMBhVRLgj7wwM78kQCQ6Tg@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
please find attached files.  if you still have difficulties getting this<br>
code running let me see your code.<br>
<br>
<br>
Thanks<br>
<br>
On Sat, Apr 16, 2011 at 12:13 PM, Gurunath Katagi <<a href="mailto:gurunath.katagi@gmail.com">gurunath.katagi@gmail.com</a><br>
> wrote:<br>
<br>
> hi ..<br>
> how r u reading the a list of values into a scalar ..<br>
> when i tried this, its taking only one value ..<br>
> please find the input file attached ..<br>
>   and kindly reply ..<br>
><br>
> Thank you<br>
> gurunath<br>
><br>
><br>
><br>
> On Sat, Apr 16, 2011 at 11:19 AM, Jagadeesh N. Malakannavar <<br>
> <a href="mailto:mnjagadeesh@gmail.com">mnjagadeesh@gmail.com</a>> wrote:<br>
><br>
>> Here is the sample script . hope this helps you<br>
>><br>
>> use strict;<br>
>> use warnings;<br>
>><br>
>> my $str =<<EOF;<br>
>> 16 50<br>
>> 16 30<br>
>> 16 23<br>
>> 17 88<br>
>> 17 99<br>
>> 18 89<br>
>> 18 1<br>
>> EOF<br>
>><br>
>> my $DATA;<br>
>><br>
>> while ($str =~ m/\G((\d+)\s+(\d+)\n)/gc) {<br>
>>     push @{$DATA->{$2}}, $3;<br>
>> }<br>
>><br>
>> foreach my $num (sort keys %$DATA) {<br>
>>     print "\n$num ", join (' ', @{$DATA->{$num}});<br>
>> }<br>
>><br>
>><br>
>> ----<br>
>> Thanks<br>
>> Jagadeesh N.Malakannavar<br>
>> 9448471968<br>
>><br>
>> 2011/4/16 Gurunath Katagi <<a href="mailto:gurunath.katagi@gmail.com">gurunath.katagi@gmail.com</a>><br>
>><br>
>>> hi .. i am new to perl ..<br>
>>> i have a input file something pasted as below ..<br>
>>><br>
>>> 16 50<br>
>>> 16 30<br>
>>> 16 23<br>
>>> 17 88<br>
>>> 17 99<br>
>>> 18 89<br>
>>> 18 1<br>
>>> ..<br>
>>> --<br>
>>><br>
>>> and i want the output something like this :<br>
>>> 16 50 30 23<br>
>>> 17 88 99<br>
>>> 18 99 1<br>
>>><br>
>>> i.e for each values in the first column, i want the elements in the<br>
>>> second column to be a one row ..<br>
>>><br>
>>> can be anybody give me psuedocode , to how to go about this ..<br>
>>> thank you<br>
>>><br>
>>> gurunath<br>
>>><br>
>>> _______________________________________________<br>
>>> Bangalore-pm mailing list<br>
>>> <a href="mailto:Bangalore-pm@pm.org">Bangalore-pm@pm.org</a><br>
>>> <a href="http://mail.pm.org/mailman/listinfo/bangalore-pm" target="_blank">http://mail.pm.org/mailman/listinfo/bangalore-pm</a><br>
>>><br>
>><br>
>><br>
><br>
<br>
<br>
--<br>
<br>
Thanks,<br>
Jagadeesh N.Malakannavar<br>
9448471968<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mail.pm.org/pipermail/bangalore-pm/attachments/20110416/c92f0638/attachment-0001.html" target="_blank">http://mail.pm.org/pipermail/bangalore-pm/attachments/20110416/c92f0638/attachment-0001.html</a>><br>

-------------- next part --------------<br>
16 50<br>
16 30<br>
16 23<br>
17 88<br>
17 99<br>
18 89<br>
18 1<br>
-------------- next part --------------<br>
A non-text attachment was scrubbed...<br>
Name: <a href="http://guru.pl" target="_blank">guru.pl</a><br>
Type: application/octet-stream<br>
Size: 323 bytes<br>
Desc: not available<br>
URL: <<a href="http://mail.pm.org/pipermail/bangalore-pm/attachments/20110416/c92f0638/attachment-0001.obj" target="_blank">http://mail.pm.org/pipermail/bangalore-pm/attachments/20110416/c92f0638/attachment-0001.obj</a>><br>

<br>
------------------------------<br>
<br>
_______________________________________________<br>
Bangalore-pm mailing list<br>
<a href="mailto:Bangalore-pm@pm.org">Bangalore-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/bangalore-pm" target="_blank">http://mail.pm.org/mailman/listinfo/bangalore-pm</a><br>
<br>
End of Bangalore-pm Digest, Vol 30, Issue 3<br>
*******************************************<br>
</blockquote></div><br>