Not sure about the code but i think below logic might work, 1) split the line into two parts , one is patterns and another is values 2) split /assign the patterns to an array and take the count 3) write a loop till the above count is reach and use the value taken in first step for each pattern in that line 4) go to second line
Cheers, Mohan From: Anamika K <anamika...@gmail.com> To: beginners@perl.org Date: 04/04/2012 06:28 PM Subject: split Hello All, I have a file like this: NM_009648,NM_001042541:1 0.955794504181601 NM_019584:1 0.900900900900901 NM_198862:1 0.835755813953488 NM_001039093,NM_001039092,NM_153080:1 0.805008944543828 and want output like this: NM_009648 0.955794504181601 NM_001042541:1 0.955794504181601 NM_019584:1 0.900900900900901 NM_198862:1 0.835755813953488 NM_001039093 0.805008944543828 NM_001039092 0.805008944543828 NM_153080:1 0.805008944543828 I am using split function first to separate column 1 with column 2 and then based upon "comma" I need to split column 1. But as you can see, in the column 1, there are sometimes more than two patterns separated by comma, so I am unable to do it in a correct way. Could you please suggest my how to proceed? Thanks. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/ This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited. Visit us at http://www.polarisFT.com -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/