From: <cde...@us...> - 2010-10-26 13:56:19
|
Revision: 7875 http://octave.svn.sourceforge.net/octave/?rev=7875&view=rev Author: cdemills Date: 2010-10-26 13:56:12 +0000 (Tue, 26 Oct 2010) Log Message: ----------- Added <TAB> as default delimiter; skip lines whose first non-blank char is # Modified Paths: -------------- trunk/octave-forge/extra/dataframe/inst/@dataframe/dataframe.m Modified: trunk/octave-forge/extra/dataframe/inst/@dataframe/dataframe.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/dataframe.m 2010-10-25 18:56:04 UTC (rev 7874) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/dataframe.m 2010-10-26 13:56:12 UTC (rev 7875) @@ -29,7 +29,7 @@ %# Each preceeding line is silently skipped. Default: none %# @item unquot: a logical switch telling wheter or not strings should %# be unquoted before storage, default = true; - %# @item sep: the elements separator, default ',' + %# @item sep: the elements separator, default '\t,' %# @end itemize %# The remaining data are concatenanted (right-appended) to the existing ones. %# @end deftypefn @@ -83,7 +83,7 @@ df = dataframe([]); %# get the right fields endif -seeked = []; unquot = true; sep = ','; +seeked = []; unquot = true; sep = "\t,"; if length(varargin) > 0, indi = 1; @@ -195,6 +195,12 @@ indl = indl + 1; indj = indj + 1; continue; endif + %# does it looks like a comment line ? + if regexp(dummy{1}, '^\s*#'), + empty_lines = [empty_lines indj]; + indl = indl + 1; indj = indj + 1; + continue; + endif %# try to convert to float the_line = cellfun(@(x) sscanf(x, "%f"), dummy, \ 'UniformOutput', false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |