How to remove single quotes
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Jan
el 16 de Mzo. de 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?
Ver también
Categorías
Más información sobre Startup and Shutdown en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!