Mismatch between file and format character vector but the CSV file contains only numerics?

17 visualizzazioni (ultimi 30 giorni)
I am receiving this error when trying to read a csv file that appears to contain only numeric values:
error.PNG
Could there be something wrong with the format of the values in the csv file? Each value ends in a newline, except for the last one.

Risposta accettata

per isakson
per isakson il 18 Giu 2019
Modificato: per isakson il 19 Giu 2019
dlmread() fails to read and convert quoted digits, e.g. "123","456","789". Neither does csvread(). See Comma-separated values. On R2018b
>> dlmread('cssm.txt')
Error using dlmread (line 147)
Mismatch between file and format character vector.
Trouble reading 'Numeric' field from file (row number 1, field number 1) ==> "123","456","789"\n
>> csvread('cssm.txt')
Error using dlmread (line 147)
Mismatch between file and format character vector.
Trouble reading 'Numeric' field from file (row number 1, field number 1) ==> "123","456","789"\n
Error in csvread (line 48)
m=dlmread(filename, ',', r, c);
Proposal:
Use the interactive tool Import Data to read the data directly or create a customized function.

Più risposte (0)

Categorie

Scopri di più su Data Import and Analysis in Help Center e File Exchange

Tag

Prodotti


Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by