[GRASS-user] Integrating multi tables

Hamish hamish_nospam at yahoo.com
Tue Mar 27 03:42:32 EDT 2007


Richard Chirgwin wrote:
> 1) When importing CSVs (I tried from Excel and from MySQL), the dbf 
> creates all the import tables as Character. I could not find any way
> to change column type to INT. Is this a limitation on the driver
> command set?


v.in.ascii first scans through the data. if it only finds integer data
it will make a integer column, floating point -> double precision, and
if it finds any non-numeric data in the column it will treat it as a
varchar() string column. You can set the column types with the columns=
option, but it should happen automatically.

This works well (and we'd be hearing about it every day if it didn't) so
check your input data for stray characters. (e.g. I'm not sure how it
handles "nan")

IIRC Excel for OSX still exports using OS9 newlines instead of UNIX
newlines, but regardless it should handle those ok (DOS newlines too).
Try opening the .csv file in a smart editor like nedit or bbedit and
save as UNIX filetype instead of MacOS9. 
(I've just tested a MacOS9 text file with v.in.ascii, table was created
fine)
?

http://www.nedit.org

maybe the .csv has column titles and you didn't use skip= or "#" ?



Hamish




More information about the grass-user mailing list