Error when reading a csv using csvread

28 views (last 30 days)
I am trying to read in a .csv file, which I have read in previously with no trouble.
Here are my command and errors:
>> A=csvread('Tawharanui5278_PSD_1sHammingWindow_50%Overlap_output.csv');
Error using dlmread (line 147)
Mismatch between file and format character vector.
Trouble reading 'Numeric' field from file (row number 394, field number 62257) ==>
...
Error in csvread (line 48)
m=dlmread(filename, ',', r, c);
Any ideas what the problem is? I think the error suggests the problem is with the command rather than the file?
Thanks for your help.

Accepted Answer

Walter Roberson
Walter Roberson on 2 Oct 2019
Row number 394 of the file is missing field number 62257
You should switch to using readtable() or readmatrix()
  11 Comments
Louise Wilson
Louise Wilson on 10 Oct 2019
Hi Walter, thanks for the code. Before I tried it, I re-copied and pasted my files using TERACOPY! This has fixed the problem so must have been bad ctrl+c and ctrl+p problem...

Sign in to comment.

More Answers (0)

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by