I need to write a code to import multiple csv files, changing delimiter and decimal standard...
37 views (last 30 days)
Show older comments
Paulo Henrique Março
on 27 Oct 2021
Commented: Paulo Henrique Março
on 28 Oct 2021
Hi guys,
I need to import multiple .csv files. Nonetheless, all my tries are going wrong: the file delimiter (even though it is .CSV, the delimiter is the semicolon (;), and the decimal is the comma (,). Please, I need help. I was doing:
P = 'fullpath';
S = dir(fullfile(P,'*.csv'));
for k = 1:numel(S)
F = fullfile(P,S(k).name);
S(k).data = csvread(F);
end
But I have the message:
Error using dlmread (line 147)
Mismatch between file and format character vector.
Trouble reading 'Numeric' field from file (row number 1, field number 1) ==> (creator description)
Error in csvread (line 48)
m=dlmread(filename, ',', r, c);
Can someone help me, please? Many thanks in advance!
0 Comments
Accepted Answer
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!