MATLAB: Convert multiple csv to xls files. csv xls Hi! I have a folder containing many excel files ( more than 200) in csv format . I need to write all these files in xls format. Can this be done in matlab . Can anyone please help. Thanks in advance Best Answer yourfolder='E:\matlab'd=dir([yourfolder '\*.csv']);files={d.name};for k=1:numel(files) old_name=files{k}; [~,~,b] = xlsread(old_name) ; new_name=strrep(old_name,'csv','xls') xlswrite(new_name,b);end Related SolutionsMATLAB: How do we convert multiple csv files to execl file in matlab orginal='D:\original'd=dir([orginal '\*.csv']); %Spelling mistake herefiles={d.name};for k=1:numel(files) filename=files{k}; fullname = fullfile(orginal,filename );%Getting the fullfile name [~,~,b] = xlsread(fullname) ; new_name=strrep(fullname,'csv','xls') xlswrite(new_name,b);end MATLAB: Fopen function how to use a variable name to select a file present in a folder The mistake is on this line:file=files(1);You need to use cell array indexing, then the code will work:file = files{1}; Related QuestionHow to print names of files or folders contained in a specific folder in first (( COLUMN A ) in excel sheetFullfile to contain multiply file extensionHow to print names of files or folders contained in a specific folder in first row in excel sheetMake a new folder with specifued name and then put 2 matrix(.xls file) inside the folderSorting the name field in dir command
Best Answer