jeudi 20 juillet 2017

fgets function in Octave not reading newline character?

I am implementing a csv parser in octave. I am using the following command to extract characters one by one from file.

c = fgets(fid,1);

I have an if block to check if c is equal to '\n' character, but it is never called. And when c encounters the newline character, it shows an empty value in the output screen as follows:

c =

But, that new line character is include in the string , which I create by appending characters extracted to c variable.So, how do I check when c variable contains a newline character.

Aucun commentaire:

Enregistrer un commentaire