read text files of unregular file types using fgets / fgetl

2 visualizaciones (últimos 30 días)
ido shabtay
ido shabtay el 6 de Mayo de 2019
Editada: Jan el 7 de Mayo de 2019
Hi,
I Have a *.gps file which is opened in notepad++ as a text file. If I change it to a .csv ot .txt file I can read rows properly with fgets or fgetl functions.
The problem is, that in my application I can't change this file type during code run, and fgets/fgetl returns only "-1".
Any suggestions?
Thanks,
Ido
  6 comentarios
Jan
Jan el 6 de Mayo de 2019
Editada: Jan el 7 de Mayo de 2019
@ido shabtay: If the posted code replies -1, either the file "a.pgs" is not existing or empty. It is not a problem of the file format.
Walter Roberson
Walter Roberson el 6 de Mayo de 2019
fgets and fgetl error if the file could not be opened. -1 is returned when eof has been reached.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Workspace Variables and MAT Files en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by