How to remove single quotes

3 次查看(过去 30 天)
Mekala balaji
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'

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by