donkost has asked for the wisdom of the Perl Monks concerning the following question:
Note that there are 2 duplicates 032-00807-0000 and 032-00820-0000. Also note that if the designator field contains only one item there are no "". Here is what the output should look like:032-00751-0000,1,R383 032-00794-0000,6,"RP1,RP2,RP3,RP22,RP24,RP26" 032-00795-0000,8,"RP10,RP11,RP12,RP13,RP14,RP15,RP16,RP17" 032-00804-0000,7,"R7,R14,R21,R23,R41,R42,R49" 032-00807-0000,2,"RP18,RP19" 032-00807-0000,4,"RP8,RP9,RP200,RP201" 032-00808-0000,3,"RP21,RP23,RP25" 032-00820-0000,5,"R966,R970,R971,R1041,R1076" 032-00820-0000,1,R3000 032-00893-0000,1,R1164
Also the designator field can get pretty big, quantities around 2000+ are not unheard of.032-00751-0000,1,R383 032-00794-0000,6,"RP1,RP2,RP3,RP22,RP24,RP26" 032-00795-0000,8,"RP10,RP11,RP12,RP13,RP14,RP15,RP16,RP17" 032-00804-0000,7,"R7,R14,R21,R23,R41,R42,R49" 032-00807-0000,6,"RP8,RP9,RP18,RP19,RP200,RP201" 032-00808-0000,3,"RP21,RP23,RP25" 032-00820-0000,6,"R966,R970,R971,R1041,R1076,R3000" 0032-00893-0000,1,R1164
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Find duplicate fields and merging data in a text file
by toolic (Bishop) on Apr 29, 2010 at 20:02 UTC | |
|
Re: Find duplicate fields and merging data in a text file
by moritz (Cardinal) on Apr 29, 2010 at 19:53 UTC | |
|
Re: Find duplicate fields and merging data in a text file
by jwkrahn (Abbot) on Apr 29, 2010 at 20:45 UTC | |
|
Re: Find duplicate fields and merging data in a text file
by Marshall (Canon) on Apr 30, 2010 at 01:18 UTC | |
by donkost (Initiate) on Apr 30, 2010 at 14:27 UTC | |
|
Re: Find duplicate fields and merging data in a text file
by choroba (Cardinal) on Apr 29, 2010 at 20:20 UTC | |
by jwkrahn (Abbot) on Apr 30, 2010 at 02:31 UTC |