Defines a table with a structure that fits the contents of your file. The Product can be saved in a VARCHAR type column.
Here is an example that you should change according to your specific case.
CREATE TABLE produtos (
id INT NOT NULL AUTO_INCREMENT,
Produto VARCHAR(255) NOT NULL,
Valor INT NOT NULL,
PRIMARY KEY (id)
);
Then to load the data you can do the following:
LOAD DATA INFILE 'c:/tmp/produtos.csv'
INTO TABLE produtos
CHARACTER SET utf8
FIELDS TERMINATED BY ';'
LINES TERMINATED BY '\r'
IGNORE 1 ROWS
(@produto,valor)
SET produto = REPLACE(@produto, 'Produto1', 'Prodúto1');
The IGNORE 1 ROWS
line should be included if your input file has a header. If you do not, remove this statement.
Set the REPLACE
statement to your needs.
As for ordering, even if you do not find the information explicitly in the documentation, it is a safe bet that the data will be inserted into the table sequentially, line by line.
However, remember that if you do not apply ORDER BY when you SELECT a table, there is no certainty about the order in which the records will be returned. Sometimes rows are allocated in a particular order and when selected from the table come in a different order.