Hi guys.
My problem is rather common but I cannot solve it. I have several .csv files that I want to combine into one (same sheet). I am trying
vars={'Temperature'; 'Relative humidity'};path = append(output_path,'\',stations{i},'\');files = append(path, 'Stats ', months ,' ', stations{i} ,' ',vars{1},' .csv'); result = table(); for fidx = 1:numel(files) filecontent = readtable(files); [~, filenumber] = fileparts(files(fidx).name); filecontent.file_label = repmat(str2double(filenumber), height(filecontent), 1); result = [result; filecontent];end
Just to help you understand, stations{i} come from the attached .xlsx and the attached .csv is one of the many files I want to combine. When I run these lines I get the message "Error using readtable, Input must be a row vector of characters or string scalar". I tried files = char(files) but it didn't work.
Any ideas please???
PS. I am on 2019a.
Best Answer