SIMILAR COMMANDS FOR CREATING .TXT FILES

조회 수: 1 (최근 30일)
Ivan Mich
Ivan Mich 2020년 5월 19일
답변: Benjamin Großmann 2020년 5월 19일
What modifications should I do in order to create a final .txt file.
I know these commands in order to create a .csv file but I do not know how to do this for .txt files
My commands:
files = dir('new*.csv') ;
N = length(files) ;
iwant = cell(N,1) ;
for i = 1:N
num = xlsread(files(i).name) ;
iwant{i} = num ;
end
iwant = cell2mat(iwant) ;
csvwrite('A.csv',iwant)
Could Anyone help me?

답변 (1개)

Benjamin Großmann
Benjamin Großmann 2020년 5월 19일
You can use dlmwrite to write an array into a text file and specify the delimiter or use fprintf to have more control about the formatting of the output.
A csv file is a ascii ("txt") file with comma as delimiter (comma separated values) and usually the file extension "csv".

카테고리

Help CenterFile Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by