How to remove single quotes
2 views (last 30 days)
Show older comments
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
0 Comments
Answers (1)
Jan
on 16 Mar 2018
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?
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!