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: Re: [Thalakos] Merge data in columns B that have same entry in column A : Edit Log



FishMonger
Veteran / Moderator

Apr 4, 2013, 12:10 PM


Views: 743
Re: [Thalakos] Merge data in columns B that have same entry in column A

Build a HoA (Hash of Arrays).

Loop over the file and split each line on whitespace. Use the value of the first column as the hash key and use the push function to add the value of the second column to the array. After the hash is built, you can loop over it and use the join function to generate the csv list.


(This post was edited by FishMonger on Apr 4, 2013, 12:14 PM)


Edit Log:
Post edited by FishMonger (Veteran) on Apr 4, 2013, 12:14 PM


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

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