I'm new with prestashop and I have an issue with importing product CSV file, especialy with the name field. it dosn't take the value of this field so i get errors every time i tried to import the file.
exemple :
ID;Active (0/1);name;Categories (x,y,z...)
100;1;Pyjama long avec haut rayé imprimé - Taupe;PYJAMA FEMME
but when I try this it work fine ::
ID;Active (0/1);nom;Categories (x,y,z...)
100;1;aaaaaaaaaaaaaaaaa;PYJAMA FEMME
HELP PLEASE
I found the answer.I had to choose 'Fichier encodé en ISO-8859-1' :OUI
Related
Stripped down example code using a static file name:
OUTPUT EXPORT /CONTENTS EXPORT=ALL /PDF DOCUMENTFILE='example.pdf'
My question is how to generate a datestamped file. I have tried using $DATE, '$DATE' and running it through a macro but can't seem to find the syntax.
Hey this is a really nice Idea for saving backups in a running syntax production - I will use this myself from now on :) .
So the following syntax works for me:
compute tdy= $time.
formats tdy (date11).
temporary.
select if $casenum=1.
write out="somepath\datemacro.sps" /"define !dated__filename () !quote(!concat('YOUR FILE NAME',' ','", tdy, "','.pdf')) !enddefine.".
exe.
Insert file ="somepath\datemacro.sps".
delete vars tdy.
The file name you used in the code above is now stored in a macro with the date added, and you can use it here:
OUTPUT EXPORT /CONTENTS EXPORT=ALL /PDF DOCUMENTFILE= !dated__filename .
Note that you can change "YOUR FILE NAME" into anything you like, including adding a path. And you can also change ".pdf" so save other kinds of files.
EDIT: Also of course change "somepath" to a valid path on your machine.
I need some help with PHPEXCEL library, everything works great, I'm successfully extracting my SQL query to excel5 file, I need to give this file to transport company in order to auto collect informations about packages, unfotunately the generated excel file has some ascii characters between each letter of the cell text, and when the excel file is imported you need to manually delete these charaters.
If I open the excel file, everything is fine I see: COMPANY NAME, If I open the excel file with notepad++, I see the cell values this way: C(NUL)O(NUL)M(NUL)P(NUL)A(NUL)N(NUL)Y N(NUL)A(NUL)M(NUL)E
If I open again the file with excel and save, then reopen with notepad++ I see COMPANY NAME.
So I do not understan why every time I create an excel file using PHPEXCEL my every letter of all words are filled with (nul) every letter.
So how do I prevent the generated excel file to include (nul) between every word????
Also if you open the original excel file generated from PHPExcel samples are also filled with (nul) and if you open and save it, the (nul) is gone.
Any help would be appreciated, thanks.
what is the (nul) ??? 0x00??? char(0)???
ok, here is the example:
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
date_default_timezone_set('Europe/London');
if (PHP_SAPI == 'cli')
die('Disponibile solo su browser');
require_once dirname(__FILE__) . '/Classes/PHPExcel.php';
$objPHPExcel = new PHPExcel();
$objPHPExcel->getProperties()->setCreator("Solidus")
->setLastModifiedBy("Solidus")
->setTitle("Import web")
->setSubject("Import File")
->setDescription("n.a")
->setKeywords("n.a")
->setCategory("n.a");
$objPHPExcel->setActiveSheetIndex(0)
->setCellValueExplicit("A1", "COMPANY")
->setCellValue('A2', 'SAMSUNG');
$objPHPExcel->getActiveSheet()->setTitle('DDT');
$objPHPExcel->setActiveSheetIndex(0);
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="TEST.xls"');
header('Cache-Control: max-age=0');
header('Cache-Control: max-age=1');
header('Cache-Control: private',false);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
ob_end_clean();
$objWriter->save('php://output');
As you can see from this little example, this scripts creates a file excel5 with 2 cells, A1 = COMPANY, A2 = SAMSUNG
when I send this file to the transport company, they import the file into their system, but as you can see from the picture, there is an weird character between each letter.
so I noticed every time I open the generated Excel5 with notepad++ file I get:
S(nul)A(nul)M(nul)S(nul)U(nul)N(nul)G
If I save the save with excel and then open it again with notepad++ I get:
SAMSUNG
and this file is ok for the transport company
so my question is, how should I avoid the file generated to contain thi '(nul) charachter between each letter????
some help?
weird characters
SAMSUNG
I found the soluion by myself, I explain just in case anyone has also this problem:
there is not way to change the way the excelfile is encoded by PHPEXCEL
so I figured out the problem was reading the file, I did some simulations and reproduce the problem, every time a read the file and put the result into inputs a get weird characters:
C�O�M�P�A�N�Y�
If I set the output enconding enconding as follows:
$excel->setOutputEncoding('UTF-8');
the file loads fine, so the problem was not creating the excel file, but reading the excel file.
If I print the variable with ECHO I get: "COMPANY",
if I put the variable on input as value I get: "C�O�M�P�A�N�Y�"
setting the output solves the problem, but I would like to know why the difference when I put the variable on input as value, thanks
I am trying to upload csv file of products in prestashop. Below are the errors that I am getting :
No Name (ID: 61,1,Orous Women's A Line Dress,Home,1399,IN Reduced Rate (4%),0,0,,,,,D2_Yellow,,,,,,,,,,,2,,,,,,"Fabric: Crepe A-line
Exquisite style patterns Gentle machine wash, dry clean, do not
bleach",,,,,,,,,1,,,,http://www.spademark.com/1154X1500/orous/D2_Yellow-_1.jpg,,,,New,,,,,,,,)
cannot be saved
and
Property Product->name is empty
What am I doing wrong?
docs http://doc.prestashop.com/display/PS16/CSV+Import+Parameters
Please use this structure for successful upload:
"Enabled";"Name";"Categories";"Price";"Tax rule ID";"Buying price";"On sale";"Reference";"Weight";"Quantity";"Short desc.";"Long desc";"Images URL"
1;"Test";"1,2,3";130;1;75;0;"PROD-TEST";"0.500";10;"'Tis a short desc.";"This is a long description.";"http://www.myprestashop/images/product1.gif"
I try to import CSV in a Neo4j Database and I have a problem.
On my desktop computer (windows 7, java 1.8.0_40-b25), the LOAD CSV works great.
But on the server (windows 2012 R2, java 1.8.0_65-b17), i have this error message "URI is not hierarchical".
I try to put the data on C:, F: ... no change.
Here's the code :
USING PERIODIC COMMIT 100
LOAD CSV WITH HEADERS FROM
"file:F:/Neo4JData/Destination.csv"
AS line
MERGE (d:Destination {`Code`: line.`Code`});
Thanks for your help.
Are you using 2.3.0 Community Edition?
try:
USING PERIODIC COMMIT 10000 LOAD CSV FROM
'file:///F:\\Neo4JData\\Destination.csv
Create an import folder in the default path of the DB and place the file there that helped me.
For example: C:\Users\XXXXY\Documents\Neo4j\default.graphdb\import and put the csv there. In the query use
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:///customers.csv" AS row
CREATE (:Customer {companyName: row.CompanyName, customerID: row.CustomerID, fax: row.Fax, phone: row.Phone});
I had the same problem. I solved it by putting /// instead of F:/ or F:///.
So if your source is
F:/FolderOne/FolderTwo/file.csv
It becomes
///FolderOne/FolderTwo/file.csv
Remember that in order to add the file you must put file: in front of the source.
So finally
file:///FolderOne/FolderTwo/file.csv
As specified above once you try with
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:///E:/AdventureWorks/adventureworks-neo4j/data/products.csv" as row
CREATE (:Product {productName: row.ProductName, productNumber: row.ProductNumber, productId: row.ProductID, modelName: row.ProductModelName, standardCost: row.StandardCost, listPrice: row.ListPrice});
The "URI is not hierarchical" error disappears. Then most probably you will get an error saying that it couldnt load the resource like
TransientError.Statement.ExternalResourceFailure
In order to solve the same you should find the neo4j.conf file.
Since i'm using a windows 10 machine and community edition of neo4j i could find the same in the below path.
C:\Users\{username}\AppData\Roaming\Neo4j Community Edition
Edit the conf file and comment out the line
dbms.directories.import=import
Doing the above steps enabled me to load the csv file.
The file path seems wrong, can you try with :
"file:F:///Neo4JData/Destination.csv"
Try with:
file:///F:/Neo4JData/Destination.csv
Putting the .csv into the $NEO4JHOME/default.graphdb/import directory worked. You may have to create the folder, or maybe uncommenting the dbms.directories.import=import line in conf might do it. I dunno, did it the hard way :)
However, I found that I still had to include the drive specifier, i.e., file:///c:\csv2import.csv even if it wasn't in the root but in the import directorry
Use the path 'file:///F:/Neo4JData/Destination.csv' and add the Destination.csv file to the neo4jDB\import directory.If the import directory is not there create a new directory named as import and add the file.
Create a folder import under default.graphdb and place your csv files there. Later, you can use file:///fileName.csv in your LOAD CSV query
I was getting this problem as well so what I did was to copy the folder in which the .csv file was present to the following location:
C:\Users\Username\AppData\Roaming\Neo4j Desktop\Application\neo4jDatabases\database-27badd10-8989-482d-871b-cad746091f07\installation-3.3.3\import\
it seems when neo4j is installed and we try to import data from files by giving "file:///c://........" then neo4j starts looking for that file in the location C:\Users\Username\AppData\Roaming\Neo4j Desktop\Application\neo4jDatabases\database-27badd10-8989-482d-871b-cad746091f07\installation-3.3.3\import\
i.e the import folder. So we have to copy all the files needed to be imported by this this type of statement in that import folder.
This one worked at my end in windows
LOAD CSV FROM 'File:///order-details.csv' AS row
RETURN count(row);
I recently exported XLIFF files using Xcode's Export for localisation tool. The files were translated and I then tried to import them but I keep getting the error "XLIFF id attribute missing". I thought maybe one of the translators messed up the file so as a test I re-exported the XLIFF file and tried to import them without making any changes to them and still got the error "XLIFF id attribute missing".
Any ideas whats going on here?
For me, this was related to this question: Xcode 6 localization. export .xliff file will cut the string when the string is like “this is sample \”text\“”
My string file looked like this:
"some english \"text\"" = "some english \"text\""
Exported in the XLIFF, it looked like this:
<trans-unit id="">
<target>some english \</target>
<source>some english \</target>
<note></note>
</trans-unit>
My translators faithfully translated it: (simulated)
<trans-unit id="">
<target>some english \</target>
<source>xyz abcdefg \</source>
<note></note>
</trans-unit>
Upon attempting to import the translated XLIFF, I received the XLIFF id attribute missing error.
To fix this, I went into my strings file and changed the entry to this:
"some english 'text'" = "some english 'text'"
and the xliff...
<trans-unit id="some english 'text'">
<target>some english 'text'</target>
<source>xyz abcdefg</source>
<note></note>
</trans-unit>
...and then imported, and it worked. Obviously at this point the translation for that one string is wrong and needs to be redone, but at least the rest of the text imported.
Edit:
I've been looking for a solution to this. I found that using curly quotes does export correctly, so the string: some english “text” produces the xliff:
<trans-unit id="some english “text”">
<source>some english “text”</source>
</trans-unit>
That's the only way I know of to do this, currently.