Alan G Isaac schrieb:
> On 9/24/2009 4:42 AM, Sven Schreiber wrote:
>> * --coloffset doesn't convince me in the case of csv files (as opposed
>> to --rowoffset in csv files, or --coloffset in spreadsheet files)
> 
> Why?  It is important to know that important data sources (like IFS)
> use the first column for a date in non-standard format.  The --coloffset
> would allow ignoring this column.
> 
> I also insist that a CSV file *is* a spreadsheet file,
> so the options valid for spreadsheet files should apply.
> 

hm yes, that makes sense I guess. So maybe you should add the
--coloffset (or --cols=...) thing to the feature request tracker on
gretl's sourceforge site, so that it doesn't get forgotten.

BTW, you said you don't want to use shell commands (for teaching)
because they're not cross-platform. Since I think you're a Pythonista
you could call Python from gretl as a kind of cross-platform shell
instead. Linux and Mac OS X come with python installed already, but of
course most of your students on windows would probably have to install
python first. Don't know if that's so bad, though.

The gretl command calling python via the shell would work something like
this:
! python -c
'f=open("myfile.csv");l=f.readlines()[offset:];f.close();o=open("file4gretl.csv","w");o.writelines(l);o.close()'

(all in one nasty long line -- don't know if the .close() things are
actually necessary here, and there are probably some bugs in there; and
don't forget to let your students enable shell commands in gretl's
preferences)

But this thing is for the rowoffset only of course. The coloffset would
require an even longer line of python commands I guess, possibly using
python's csv module.

good luck,
sven


Reply via email to