how to split the string to cells?

조회 수: 10 (최근 30일)
sandy
sandy 2013년 8월 12일
i have a text file contains following data,
SAMPLE_20120807_1806 0 +1.122117E+1 +7.190077E+0 +1.460343E+1
..i opened this and,but the output variable stored this line in a single cell itself like this (1*234 char).but i need to split each and values to be stored in separate cells in excel file...i stuck here..can anyone suggest code there in matlab?
%if true
folder='F:\run\';
file=fullfile(folder,'SAMPLE_20120807_1806.run');
a=fileread(file);
dlmwrite('file.xls',a,'');
%end
  댓글 수: 1
sandy
sandy 2013년 8월 13일
can anyone tel me how to put this in a loop?

댓글을 달려면 로그인하십시오.

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 8월 12일
s='SAMPLE_20120807_1806 0 +1.122117E+1 +7.190077E+0 +1.460343E+1'
regexp(s,' ','split')
  댓글 수: 2
sandy
sandy 2013년 8월 12일
thanks...it works..
sandy
sandy 2013년 8월 12일
hi azzi... for single file to split is done..but i have 10 files to split like and append al files to single excel file is problem here nw,help me.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by