How to convert csv file to .dat file?
131 views (last 30 days)
Voss on 18 Mar 2022
Edited: Voss on 18 Mar 2022
% read the csv file:
data = readmatrix('data.csv')
% write the data to .dat file using
% space as the delimiter (no commas):
% check that the .dat file looks right:
fid = fopen('data.dat');
dat_data = fread(fid,'*char').';
disp(dat_data); % looks good
I assumed the .csv file contains just numbers. If that's not the case, then you'd have to use functions other than readmatrix() and writematrix().