How to import data from a single cell in a CSV file

Hi, My problem is very simple yet I haven't found an answer that would work. I would like to extract a value from a CSV file cell using the following line:
Mp329=csvread(Data.csv',404,128, 'DY404..DY404');
This should extract the cell at the 404th row and 128th column position. The variable Mp329 is generated but it is an empty table. What is missing? Why is that variable is just an empty table? Thanks!!!

2 commentaires

I know this is probably something you already check, but are you sure it's going to the right location?
I suspect that what might be happening is that your r,c inputs are moving the entire table the selected number of times, and then it is drawing the DY404 value from the now displaced table. Try loading the entire displaced table first and see if the cell you're looking for is in the A1 position.
Marton Szogradi
Marton Szogradi le 12 Fév 2018
Modifié(e) : per isakson le 13 Fév 2018
Yes it is the right location, the table is not displaced, but I found the solution:
Mp329=xlsread('Becker_run329v2_2050100.csv', 1,'DY128:DY128');
The source csv file does not look like a regular csv (everything compressed into the first column) but the colulmns are separated like a regular xls file. Although the extension is csv...FYI Office2016 was used.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Data Import and Analysis dans Centre d'aide et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by