[GRASS5] db.oodbfedit: a _very_ simplistic approach to dbf attribute editing

Moritz Lennert mlennert at club.worldonline.be
Sat Aug 6 17:03:32 EDT 2005


On Sat, August 6, 2005 2:20, Daniel Calvelo Aros said:
>
> He, he. No, that's not true anymore. What you have now is (test please, test
> please, test please):
>
> update table foo set bar=baz/2+1/(-4*toto);
>
> in addition to
>
> select * from foo where 1-(-4)/bar=2+baz

This seems to work perfectly, at least for the expressions I've tried.

> Furthermore, in http://grass.itc.it/pipermail/grass5/2005-June/018589.html I
> asked for testing an updated d.vect.thematic that handled (with the above
> patches in the parser) thematic mapping from expressions.

This also seems to work, after applying the following patch in v.univar.sh:

--- v.univar.sh 2005-08-06 21:35:38.814231960 +0200
+++ /usr/lib/grass/scripts/v.univar.sh  2005-08-06 22:26:33.626829856 +0200
@@ -131,7 +131,7 @@
   gsub(" ","",expression);
   split(col_list,vars,",");
   for(i in vars){
-    gsub(vars[i], "\$" i, expression);
+    gsub(vars[i], "$" i, expression);
   }
   if(expression~/\//){
     theres_div=1;

With gawk the \$ is corrected automatically (but a warning is displayed), but
with mawk (debian's default awk) it fails. Without the \ everything seems to
work (again only rapid testing).

Thanks a lot Daniel: this makes both v.db.update and d.vect.thematic much more
useful !

Moritz




More information about the grass-dev mailing list