I was wondering if you could help me with a coding problem which I can’t get my head around. The tab-delimited data I have looks like something like the following:
00001 AU:137 AU:150 AU:180
00001 AU:137 AU:170
00002 AU:180
00003 AU:147 AU:155
00003 AU:155
The output I want is:
00001 AU:137 AU:150 AU:180 AU:170
00002 AU:180
00003 AU:147 AU:155
So the first column (identifier) will merge the values, removing duplicates, so that it becomes a hash. I’m not sure how to work with my current data because it can’t be a hash having duplicate keys. I’m also not sure how to push the data into an array if the identifier is the same.
I apologize for not having a code. I did try a few, actually, quite a lot, but they don’t look right even to a newbie like myself.
Any help, suggestions would be greatly appreciated and thank you so much for your time and answer. I greatly appreciate it.
Script:
Output: