Textscan blanks disappears from file

2 visualizaciones (últimos 30 días)
Valentino
Valentino el 1 de Mzo. de 2018
Respondida: Valentino el 1 de Mzo. de 2018
Hi guys,
when i read my text file which looks like this:
0.0000 0.3826004
0.0100 0.395591
0.0199 0.4085815
the blanks in the front get lost so my output looks like this:
0.0100 0.395591
my code is simple:
fileID=fopen(fullfile(pathname,files));
formatSpec = '%s';
input = textscan(fileID,formatSpec,'delimiter','\n');
fclose(fileID);
i want to handle it as strings because the shape of the file is arbitrary thanks

Respuesta aceptada

Valentino
Valentino el 1 de Mzo. de 2018
Had to add
input = textscan(fileID,formatSpec,'delimiter','\n','whitespace','');

Más respuestas (0)

Categorías

Más información sobre Data Import and Export 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!

Translated by