CSV datafiles: document it, autodetect extension
parent
8311caf304
commit
f92965b28c
|
@ -3961,7 +3961,7 @@ graphs of smoothed shocks, smoothed observation errors, smoothed and historical
|
||||||
|
|
||||||
@item datafile = @var{FILENAME}
|
@item datafile = @var{FILENAME}
|
||||||
@anchor{datafile}
|
@anchor{datafile}
|
||||||
The datafile: a @file{.m} file, a @file{.mat} file or, a
|
The datafile: a @file{.m} file, a @file{.mat} file, a @file{.csv} file, or a
|
||||||
@file{.xls}/@file{.xlsx} file (the latter format is supported under Octave
|
@file{.xls}/@file{.xlsx} file (the latter format is supported under Octave
|
||||||
if the @uref{http://octave.sourceforge.net/io/,io} and
|
if the @uref{http://octave.sourceforge.net/io/,io} and
|
||||||
@uref{http://octave.sourceforge.net/java/,java} packages from
|
@uref{http://octave.sourceforge.net/java/,java} packages from
|
||||||
|
|
|
@ -17,7 +17,7 @@ function dyn_data_01=read_variables(file_name_01,var_names_01,dyn_data_01,xls_sh
|
||||||
% all local variables have complicated names in order to avoid name
|
% all local variables have complicated names in order to avoid name
|
||||||
% conflicts with possible user variable names
|
% conflicts with possible user variable names
|
||||||
|
|
||||||
% Copyright (C) 2005-2012 Dynare Team
|
% Copyright (C) 2005-2013 Dynare Team
|
||||||
%
|
%
|
||||||
% This file is part of Dynare.
|
% This file is part of Dynare.
|
||||||
%
|
%
|
||||||
|
@ -54,8 +54,10 @@ if isempty(extension)
|
||||||
extension = '.xls';
|
extension = '.xls';
|
||||||
elseif exist([basename '.xlsx'],'file')
|
elseif exist([basename '.xlsx'],'file')
|
||||||
extension = '.xlsx';
|
extension = '.xlsx';
|
||||||
|
elseif exist([basename '.csv'],'file')
|
||||||
|
extension = '.csv';
|
||||||
else
|
else
|
||||||
error(['Can''t find datafile: ' basename '.{m,mat,xls,xlsx}']);
|
error(['Can''t find datafile: ' basename '.{m,mat,xls,xlsx,csv}']);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue