CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
2D array:print rows whose first element matches.

 



samantha grace
New User

Dec 24, 2008, 4:09 AM

Post #1 of 2 (408 views)
2D array:print rows whose first element matches. Can't Post

hi,

i have a situation where i need to find and print all the rows in a two dimensional array whose first element matches.

my 2d array looks like this:

[name1,10,function_name1]
[name1,16,function_name2]
[name2,5,function_name3]
[name2,44,function_name1]
[name3,32,function_name4]
[name4,24,function_name5]

the output should be something like this:

[name1,10,function_name1]
[name1,16,function_name2]
[name2,5,function_name3]
[name2,44,function_name1]

i.e all rows with repeated first element i.e with the same name.


any help is welcome!!


thanks,
Sam


KevinR
Veteran


Dec 24, 2008, 9:58 AM

Post #2 of 2 (395 views)
Re: [samantha grace] 2D array:print rows whose first element matches. [In reply to] Can't Post

What have you tried so far?
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives