| Recommend this page to a friend! |
| All requests |
> | array manipulation and db insertion | > | Request new recommendation | > | > |
by florina tudor - 9 years ago (2017-05-09)
0 | I need to parse large csv files which contains Categories to be inserted into a database, while doing the following: - select distinct first column as 1st level parent Categories - select distinct second column as 2nd level child Categories, depending on what first the first column value is - repeat until the last column Not all lines have all values. There are duplicates - Categories of different levels and with different parent categories have the same name, however, each line contains a unique combination of values. For each category I need to fill the following fields: ID, PARENT ID*, ALL HIGHER LEVEL CATEGORIES IDs delimited by |, NAME All IDs have to be integers. Example of csv: Animalerie,Abeilles,Accessoires,, Animalerie,Abeilles,Alimentation,, Animalerie,Abeilles,Attire-essaims,, Animalerie,Rongeurs,Maison,Accessoires, Animalerie,Rongeurs,Piège,, Animalerie,Rongeurs,Poulailler,, Bagagerie/Bijoux/Mode,Bagagerie,Accessoires bagages,Cadenas,sangles Bagagerie/Bijoux/Mode,Bagagerie,Accessoires bagages,Confort de voyage, Bricolage,Boulonneuses,,, Bricolage,Coffrets outils,,, I'm mostly interested in an idea on how best to approach the issue, rather than a class per se. Just looking at classes might do the trick. In case somebody does read these messages, thank you for your time and have a nice day, Florina |
| Recommend package | |
|
|