help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Error Reading a file


From: Thomas D. Dean
Subject: Error Reading a file
Date: Tue, 28 Jun 2016 11:43:22 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0

I have a problem with octave reading an ascii file, based on its contents. There are no strange characters in the file. Am I doing something wrong?

octave:1553> type xx
## Copyright (C) 2016 Thomas D. Dean
##
## This is free software: you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free
## Software Foundation, either version 3 of the License, or (at your
## option) any later version.
##
## This code is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this file.  If not, see <http://www.gnu.org/licenses/>.
##

## -*- texinfo -*-
## @deftypefn{Function File} address@hidden row_idx}  get_row_index (@var{name})
## Function to provide the row index into the planet data array.
## get_key ( description ) will provide a cross reference from description
## to name.

octave:1554> function []=aa()
> fp = fopen("xx","r");
> while ( (str = fgetl(fp)) != -1)
> disp(str);
> endwhile;
> fclose(fp);
> endfunction;

octave:1555> aa
## Copyright (C) 2016 Thomas D. Dean
##
## This is free software: you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free
## Software Foundation, either version 3 of the License, or (at your
## option) any later version.
##
## This code is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this file.  If not, see <http://www.gnu.org/licenses/>.
##

octave:1556> system("hd xx")
...

shows no strange characters in the file.

Tom Dean



reply via email to

[Prev in Thread] Current Thread [Next in Thread]