[GRASS5] v.in.ascii import failure

Hamish hamish_nospam at yahoo.com
Fri Mar 4 22:54:50 EST 2005


> in GRASS 6.0 cvs, there is a problem importing ascii coordinate pairs
> with v.in.ascii. Using cat test.txt | v.in.ascii fs='|' out=mymap
> doesn't work:
> 
> 
> 599251|4927066 
> 599090|4926953 
> 599097|4926472 
> 599280|4925969 
> 599863|4926391 
> 599849|4926841
> 
> Error:
> Maximum input row length: 16
> Maximum number of columns: 2
> Minimum number of columns: 2
> ERROR: y column is not of number type
..
> Why is this? Do I always need 3 columns? 


Note the trailing spaces in the above data. column two is "4927066 "
which is a string not a numeric. Get rid of the trailing spaces and it
works fine with two column input.



Perhaps v.in.ascii should use G_strip() after G_getl2()? but then what
happens when you want a string with trailing newlines? (e.g. keep
whitespace padding for other software)
Maybe ok if just G_strip() whole input line not each individual field?




Hamish




More information about the grass-dev mailing list