jomcdonald Posted July 3, 2012 Share Posted July 3, 2012 Bonjour, Voila, j'ai un fichier XML avec plusieurs valeurs d'un même élément. Si j'ouvre ce fichier sous excel voici comment il se présente: Référence | Marque | Prix | Image | --------------------------------------------------------------------- HQ-HA30 | HQ | 14.42 |HQ-HA30-1.jpg | HQ-HA30 | HQ | 12.36 |HQ-HA30-2.jpg | HQ-HA30 | HQ | 11.21 |HQ-HA30-3.jpg | HQ-HA60 | HQ | 20.95 |HQ-HA60-1.jpg | HQ-HA60 | HQ | 19.62 |HQ-HA60-2.jpg | HQ-HA60 | HQ | 18.71 |HQ-HA60-DETAIL.jpg | J'ai besoin d'exporter ce fichier en CSV avec un affichage différent afin que toute les valeurs d'un produit soit affiché sur une seule ligne pour me permettre de l'importer dans prestashop. Exemple de sortie souhaitée: Référence| Marque| Prix | Image | ------------------------------------------------------------------------------- HQ-HA30 | HQ | 14.42;12.36;11.21 |HQ-HA30-1.jpg ; HQ-HA30-2.jpg ; HQ-HA30-3.jpg | HQ-HA60 | HQ | 20.95;19.62;18.71 |HQ-HA60-1.jpg;HQ-HA60-2.jpg;HQ-HA60-DETAIL.jpg | Quelqu'un connait-il une astuce. Merci Link to comment Share on other sites More sharing options...
devprestacom Posted July 4, 2012 Share Posted July 4, 2012 Bonjour, Je pense que tu peux facilement parser le xml pour construire ton csv. C'est assez simple. Cordialement, Link to comment Share on other sites More sharing options...
jomcdonald Posted July 4, 2012 Author Share Posted July 4, 2012 Oui, mais je ne sais pas faire. Faut-il un logiciel spécial, Excel permet-il de le faire... Link to comment Share on other sites More sharing options...
devprestacom Posted July 4, 2012 Share Posted July 4, 2012 Bonjour, Il ne faut pas un logiciel spécial pour celà. Je vous invite à regarder ceci : http://www.commentcamarche.net/contents/php/phpxml.php3 http://php.net/manual/fr/function.fgetcsv.php http://www.journaldunet.com/developpeur/tutoriel/php/060531-php-fputcsv.shtml Je reste disponible Cordialement, Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now