read text files of unregular file types using fgets / fgetl

조회 수: 3 (최근 30일)
ido shabtay
ido shabtay 2019년 5월 6일
편집: Jan 2019년 5월 7일
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
Jan
Jan 2019년 5월 6일
편집: Jan 2019년 5월 7일
@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 2019년 5월 6일
fgets and fgetl error if the file could not be opened. -1 is returned when eof has been reached.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by