[GRASS-user] how to change imported table column definitions -
using 6.4 in Win XP
Stuart Edwards
sedwards2 at cinci.rr.com
Thu Feb 11 08:46:16 EST 2010
sorry Marcus - forgot the list .....
On Feb 11, 2010, at 3:04 AM, Markus Neteler wrote:
> On Tue, Feb 9, 2010 at 3:40 PM, Stuart Edwards <sedwards2 at cinci.rr.com> wrote:
>> On Feb 9, 2010, at 5:11 AM, Laszlo Nagy wrote:
>>>
>>> (!) Have imported a csv to make a vector map. All cols are listed as char.
>>> There are numeric columns (either two decimal values) that are listed as
>>> char. How can I change them to be numeric?
>
> Create a .csvt file with the name of the .csv file (see manual of db.in.ogr).
> In this CSV-types file you can specify a type for each column.
>
>> I had trouble with this recently - one cause of the problem in my case was
>> the presence of data gaps -- any column with a data gap seemed to be
>> imported as a 'char' column. When I modified the table to eliminate missing
>> data it worked fine.
>
> Perhaps it included white spaces?
>
> Markus
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
Thanks for the hint. I wasn't familiar with the .csvt format. I don't think there were any white spaces in my .csv files - e.g. '261,446,434,401,,346' would indicate a missing value in the column between 401 and 346 - I also tried NULL and NA as options without success.
thanks again,
Stu
More information about the grass-user
mailing list