[Gvsig_english] dbf table Date format issue
Simon Cropper
scropper at botanicusaustralia.com.au
Tue May 3 01:06:35 CEST 2011
On 02/05/11 23:03, georgsedlmeir wrote:
> Dear list,
> I created a .dbf table from an OpenOffice document and imported it into
> gvSIG (1.10). The table contains two attributes storing dates (dd.MM.yy) in
> String format. However, I'd like them to be in real Date format for further
> computing. Using gvSIG's table calculator to convert from String to Date
> format worked fine, but once the Date attribute is filled with the values
> converted from string format, it is no longer possible to finish editing and
> save the table. Even after deletion of the freshly added field the table
> can't be saved and remains unuseable. Please find attached the corresponding
> error shown in the console popping up in gvSIG. Any suggestions and help
> would be much appreciated, thanks in advance.
>
> Best regards,
> Georg
>
Georg,
There could be many reasons for this. Dbase files are a very old file
format and have specific rules when it comes to field names, duplicate
field names, number format, etcetera. The problem may also be related to
code page changes.
Can you provide some specifics?
1. What OS are you using? What package and version did you use to create
the table?
2. What OS and codepage was the table created. It sounds like you
created a table then tried using gvSIG as a table editor and that the
table is not associated with a spatial layer. Why are you editing them
in gvSIG? if you are using OO you can edit the file using Calc and Base.
3. What are the field names? What are the names of the 'new' date
fields? Have you tried creating the empty data fields in base/calc or
whatever you used then opening in gvSIG.
4. What are the exact steps you take to cause the error?
Note also that it is unclear what format OO actually creates DBF tables.
I have had troubles getting anyone to verify if the table editing
routines are working on dBase III or dBase IV format. Tables associated
with spatial layers are actually dBase III format -- the routine in
gvSIG would only work if the tables were in this format. Differences in
the table headers may also be the cause of the error.
Is the file small? If so, try posting the file somewhere and outlining
the steps you tried to do and I will see if I can reproduce the error.
If you are using Windows and all you want to do is edit the table there
are numerous freeware packages for editing DBF files. If you are in
Linux, LibreOffice is probably the best option.
One sure way to circumvent these problems (assuming you don't have code
page issues) is to create a table in gvSIG with all the necessary
fields. Dump some dummy data into the first record for fun. Open in OO
and put all the actual data into the table (remembering to remove you
dummy first record) then open the file in gvSIG (again) for editing. If
you are using Windows ensure OO and gvSIG are both using CP1252, if you
are using Linux then UTF8 is OK.
It seems that OO stores it data in UTF-8
http://wiki.services.openoffice.org/wiki/Documentation/BASIC_Guide/Strings
--
Cheers Simon
Simon Cropper
Website administrator
http://gis.fossworkflowguides.com
More information about the Gvsig_internacional
mailing list