[STATSGRASS] v.in.ascii

Markus Neteler neteler at itc.it
Fri Jan 27 06:27:31 EST 2006


On Fri, Jan 27, 2006 at 11:58:12AM +0100, Poizot Emmanuel wrote:
> Hi all,
> I try to import an ascii file which is, I think, very simple:
> x,y,z
> 276.0447173760,10.1098557284,1030.7103
> 276.0445919261,10.1095942026,1035.0991
> 276.0445111456,10.1096214593,1030.4924
> 276.0436962475,10.1098881088,960.6209
> 276.0435313979,10.1099409839,943.3556
> 276.0446891003,10.1092347607,1024.1261
> 276.0445275703,10.1092891300,1014.5844
> 276.0442016736,10.1093973778,991.0519
> 276.0437099357,10.1095639911,964.0923
> 276.0425563156,10.1099390665,857.2236
> 276.0428807613,10.1095049230,881.3990
> 276.0426860979,10.1092362057,846.4199
> 276.0426027050,10.1092605084,831.0676
> 276.0424370843,10.1093135629,813.6218
> 276.0420994045,10.1094279057,793.6904
> 276.0417642082,10.1095263714,736.5096
> 276.0415915260,10.1095740807,704.4528
> 276.0415049539,10.1095962648,684.4412
> 276.0410706576,10.1097332895,635.3551
> 276.0445780653,10.1082764653,974.5306
> 276.0441651294,10.1084116702,938.8713
> 276.0439161533,10.1084955855,923.2671
> 276.0438312499,10.1085257975,923.2946
> 276.0435768728,10.1086119170,916.9979
> 276.0428361340,10.1088463903,840.5004
> 276.0426783175,10.1088861157,796.0822
> etc.........
> 
> in total arround 869000 lines of x,y,z values.
> I tried this:
> v.in.ascii input=theinputfile.txt output=theoutput fs=',' -z z=3
> but didn't work. I've got the message:
> Maximum input row length: 39
> Maximum number of columns: 3
> Minimum number of columns: 3
> ERROR: x column is not of number type
> That's not verbose enought for me to find what's wrong.
> Does anybody have an idear ?
> Thanks

I ad such a problem once, there was a space at the end of the line
somewhere.
You may filter the data like this:

cat theinputfile.txt | sed 's+ ++g' > theinputfile_clean.txt

then import 
v.in.ascii input=theinputfile_clean.txt output=theoutput fs=',' -z z=3

In fact the message should indicate the offending line, but I
don't know how to implement that. Maybe the author of v.in.ascii knows.

Please let us know if this trick helped.

Markus




More information about the grass-stats mailing list