Hi
Thanks for the feedback.
Both suggestions work:
a) I downloaded a 2016-version, and could easily open the file. Lots of
variables with "_" beginning in file was there.
b) unzipping the GDT-file (with 7-zip), and editing in editor, also worked.
Thanks,
Dagfinn
Dagfinn Rime
Professor of Finance | BI Norwegian Business School <
man. 27. mai 2019 kl. 17:28 skrev Riccardo (Jack) Lucchetti <
r.lucchetti(a)univpm.it>:
On Mon, 27 May 2019, Dagfinn Rime wrote:
> Dear Gretl community,
>
> I have a Gretl file, last saved in 2017, that I now can't open. I have
> updated my Gretl to 2019-build.
>
> Error message:
> First char of varname '_DAY' is bad
> (first must be alphabetical)
>
> a) can I download old version from somewhere?
> b) is it an easy way to take a Gretl gdt-file and convert it to CSV?
>
> Thanks in advance
It's very weird that you were able to create such a file in the first
place. As far as I can remember, series identifiers beginning with an
underscore have neve been legal in gretl, so I wonder how a file like
that could have been written by gretl in the first place.
Anyway: gdt files are just xml files, possibly gzipped. You can edit them
directly with any text editor. For example (assuming you use windows, like
70% of gretl users does), try this:
_____________________________________________________________________________
1) locate the file data4-1.gdt from the "ramanathan" collection. On a
typical windows install, its full path should be something like
C:\Program Files\gretl\data\ramanathan\data4-1.gdt
2) open it with a text editor; WordPad, for example, will do beautifully
(NotePad is a bit more awkward, since it botches line endings). You should
see something like
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE gretldata SYSTEM "gretldata.dtd">
<gretldata version="1.3" name="data4-1"
frequency="1" startobs="1"
endobs="14" type="cross-section">
<description>
DATA4-1: Data on single family homes in University City
community of San Diego, in 1990.
price = sale price in thousands of dollars (Range 199.9 - 505)
sqft = square feet of living area (Range 1065 - 3000)
bedrms = number of bedrooms (Range 3 - 4)
baths = number of bathrooms (Range 1.75 - 3)
</description>
<variables count="4">
<variable name="price"
...
3) navigate down until you see the tag
<variable name = "_DAY"
and change it to something suitable (eg. "DAY")
4) save the file as text, with a .gdt extension. At that point, you should
be able to open the file ok
_____________________________________________________________________________
If you try the above on the file data3-14.gdt from the same collection,
you'll just see garbage; that happens because that file is compressed
(technically: gzipped), so you need to decompress it first. In order to do
so, there are several tools you may use, a very nice one being 7zip
(freely downloadable from
https://www.7-zip.org/download.html)
So you can open the file with the 7zip file manager, uncompress it to a
location of yuor choice, and then edit it with WordPad.
Hope this helps!
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------_______________________________________________
Gretl-users mailing list -- gretl-users(a)gretlml.univpm.it
To unsubscribe send an email to gretl-users-leave(a)gretlml.univpm.it
Website:
https://gretlml.univpm.it/postorius/lists/gretl-users.gretlml.univpm.it/