Extra Characters when saving .m files

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Extra Characters when saving .m files

Sarah Carnochan Naqvi
When I edit a .m file in the editor and save the file. It is adding
hidden characters to the file in the first line.  I can see them in
Notepad++, but not in the OCTAVE Editor.

The error at the command line in OCTAVE is:

parse error near line 1 of file E:\octave\student-qs\GCL.m

   syntax error

 >>>
~}#=========================================================================

The first line of the file from Notepad ++ is:

~}#=========================================================================

The line same line in the Octave editor is:

#=========================================================================

I'd really appreciate some help stopping this from happening.

Thank you,
Sarah



Reply | Threaded
Open this post in threaded view
|

Re: Extra Characters when saving .m files

Andreas Weber-6
Hi Sarah,

Am 20.09.20 um 23:04 schrieb Sarah Carnochan Naqvi:

> When I edit a .m file in the editor and save the file. It is adding
> hidden characters to the file in the first line.  I can see them in
> Notepad++, but not in the OCTAVE Editor.
>
> ...
> The first line of the file from Notepad ++ is:
> ~}#=========================================================================
>
> The line same line in the Octave editor is:
> #=========================================================================

Can you please upload a minimal example (or the original) and provide a
link?

I can just guess it has some special encoding or a perhaps a BOM
(https://de.wikipedia.org/wiki/Byte_Order_Mark)?

Have you created the file from within GNU Octave or in another editor
and then edited in GNU Octave?

-- Andy