How to remove single quotes

조회 수: 3 (최근 30일)
Mekala balaji
Mekala balaji 2018년 3월 16일
댓글: Mekala balaji 2018년 3월 16일
Hi, I have below data cell array of mixed data:
'2018-02-01' '22:11:23' '22:12:15' 'Va#VSF04TH00' 'KU' '0' '1.00' '47' 'JKP01'
'2018-02-01' '23:16:23' '22:16:15' 'Va#VSU04TH00' 'UL' '0' '5.00' '47' 'TKP01'
'2018-02-01' '22:20:23' '22:45:12' 'Ja#VSF04TH00' 'PA' '4' '11.00' '87' 'JKP01'
I want to remove ' ', and write to csv file

답변 (1개)

Jan
Jan 2018년 3월 16일
The quotes are most likes not included in the data, but inserted only for displaying the data in the command window. Unfortunately you did not post, how you have created the shown output.
Data = {'2018-02-01' '22:11:23' '22:12:15' 'Va#VSF04TH00' 'KU' '0' '1.00' '47' 'JKP01'; ...
'2018-02-01' '23:16:23' '22:16:15' 'Va#VSU04TH00' 'UL' '0' '5.00' '47' 'TKP01'; ...
'2018-02-01' '22:20:23' '22:45:12' 'Ja#VSF04TH00' 'PA' '4' '11.00' '87' 'JKP01'};
fid = fopen(FileName, 'w');
if fid == -1
error('Cannot open file: %s', FileName);
end
DataT = Data.';
fprintf(fid, '%s, %s, %s\n', DataT{:});
fclose(fid);
Does this work?
  댓글 수: 1
Mekala balaji
Mekala balaji 2018년 3월 16일
I read the unformated text file, and each data point is separted by,(comma), and I want break at each string of '2018-02-01'

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by