fonction import

More
12 years 1 month ago #29805 by tonnick
fonction import was created by tonnick
hello !

juste une question sur la fonction import.

Si on ne met pas de delimitateur devant le premier item, cela ne fonctionne pas. ok.

Mais dans un fichier CSV, la premiere colonne est directement le premier groupe de mots. il n'y a pas de ~~

Il faut les ajouter à la main une fois terminé le csv avec notepad. et si par exemple, je m'aperçois que j'ai oublie qq chose, l'editeur (open office pour ne pas le citer) comprend qu'a cause de ces ~~ en debut, la premiere colonne est vide et me decale tous les contenus par rapport aux titres...

N'y a-t-il pas moyen de changer cela pour importer un csv "normal" ?

(FLEXIcontent version 2.0.0 RC8 (r1486))

merci de votre aide !

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #29808 by ggppdk
Replied by ggppdk on topic fonction import
You can configure, whatever format you have ...
just set the format that your CSV file has

everything is configurable, the suggested separator is to add more robustness to it


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #29812 by tonnick
Replied by tonnick on topic fonction import
yes you're right, it's better use separators.

but first of all, if I use ; instead of ~~, it does not work (of course remplacing ~~ by ; in Field Separator).

then, if I use as recommanded ~~, why do I have to put it before item column and not before field names column ?

this is not standard CSV format, I have to add it manually, and if I need modificate my file once ~~ added, it moves all columns itemns....

how can we avoid it ?

And one more thing, I have weblinks. But I cannot import them with title.

here is an exemple of my file :
"title"~~"text"~~"state"~~"type_of_product"~~"country"~~"world_regions"~~"legal_protection"~~"national_legislation"~~"external_link"
~~"Atest3"~~~~"3"~~"agricultural_product_and_foodstuff"~~"ES"~~"europe"~~"sui_generis"~~"[-addr-]=http://ec.europa.eu/agriculture/quality/door/registeredName.html?denominationId=1839!![-text-]=law"~~"[-

addr-]=http://ec.europa.eu/agriculture/quality/door/registeredName.html?denominationId=1839!![-text-]=link"

Could you detect where is the mistake ? thx for your help !

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #29813 by ggppdk
Replied by ggppdk on topic fonction import
since all separators are configurable i don't see what the problem is ??

first you need to clarify what you "standard" CSV file is using as field separators and as record (item) separators

e.g. for "standard" CSV use:
Field Separator: \t (this means description must not contain \t)
Field Encloser Character:
Item Separator: \n

also since you use enclosing character:
this
~~"Atest3"~~~~
should be:
~~"Atest3"~~""~~


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #29814 by tonnick
Replied by tonnick on topic fonction import
as said before, problem is not on separators, but on the way it is used.

1. if I use other field separators than the ones suggested (; instead of ~~), it does not work, so, all separators are not configurable. anyway doesn't really matter.

2. usual csv is :
title ~~ text ~~ textfield3 ~~ emailfield6 ~~ weblinkfld8 ~~ single_value_field22 ~~ multi_value_field24
title 1 ~~ description 1 ~~ textfield3 value ~~ [-email-]=usera@somedomain.com!![-text-]=usera ~~ www.somedomaina.com ~~ f22_valuea ~~ f24_value01%%f24_value02%%f24_value03

and not

title ~~ text ~~ textfield3 ~~ emailfield6 ~~ weblinkfld8 ~~ single_value_field22 ~~ multi_value_field24
~~ title 1 ~~ description 1 ~~ textfield3 value ~~ [-email-]=usera@somedomain.com!![-text-]=usera ~~ www.somedomaina.com ~~ f22_valuea ~~ f24_value01%%f24_value02%%f24_value03

Do you see the difference ?

in the import function we have to add on all item separators before the item itself.

this is a manual operation which :
- make lose time
- can be root cause of importations errors
- create issue when I need to modify the CSV with table programm as open office for exemple.

so, first question is, whatever the separator used, how can we avoid this phenomen and import usual csv ?

Then second question is for the weblinks, I cannot make it work. Can you see any error in the syntax ?


thx a lot for your dedicated time !

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #29819 by ggppdk
Replied by ggppdk on topic fonction import
inside
administrators/components/com_flexicontent/controllers/items.php

and inside function importcsv()

there is a line :
//echo "<pre>"; print_r($data); exit;

change it to :

echo "<pre>"; print_r($data); exit;

to see how you data of the FIRST item (first row) was parsed


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.436 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline