I am trying to load data from a csv file. I have been told to use textscan
, but when I try to load the file using csvread
I get the error "undefined near line 1 column 16". I get the same error, but with different column position, when trying to use similar methods such as fileread
and textread
.
Here is the link to the csv file https://drive.google.com/open?id=0ByD1GZqyS54ZV3ZoVFltYzZ6eE0 and here is a picture of the file.
I know it would be easier to simply remove the other, unwanted content, because I just need the data from columns E, F, G, and K, and could then use dlmread
or csvread
on these numeric values. Still, this does not seem like it should be that hard. Can you please help me understand how to load string data from a file in with MATLAB or Octave?
Update 08/20/17 (UTC+7)
thanks for the answer, especially from information (this is userid right?)
i think the problem probably cause by the first row that have 26 cells and the other 4 just 20, so i decide to remove data after column K and we have 11 column and then run :
fid=fopen('tesdata.dat'); %i change the data in csv to dat file
c=textscan(fid,'%f%s%s%s%f%f%d8%s%s%s%f');
fclose(fid);
this works for my case, so i think the problem probably the different column size. well i do think this could work if the file in csv with csvread