<div>Hi Peter,</div>
<div> </div>
<div>Following Moritīz suggestion, how about you use R on this task?</div>
<div> </div>
<div>
<p>#The code below is to you read your dbf file<br>#so remove the # and include your full path/file name<br>#require(foreign)<br>#my.dbf<-read.dbf("c:/temp/myfile.dbf") #</p>
<p><br>#below we simulate a data.frame (it is a table)</p>
<p>my.dbf<-data.frame(cbind(var1=c("GRASS001","GRASS002","GRASS003")))<br>my.dbf</p>
<p>#below you have a code to "deparse" your variable of interest</p>
<p>my.dbf$var2_char<-substr(my.dbf$var1,6,999)<br>my.dbf</p>
<p>my.dbf$var2_int <-as.numeric(as.character(my.dbf$var2_char))<br>my.dbf</p>
<p> </p>
<p>Cheers,</p>
<p> </p>
<p>miltinho</p>
<p>brazil<br> </p><br><br> </div>
<div><span class="gmail_quote">2008/8/6, Moritz Lennert <<a href="mailto:mlennert@club.worldonline.be">mlennert@club.worldonline.be</a>>:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><span class="q">On 06/08/08 15:09, <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:peter.loewe@gmx.de" target="_blank">peter.loewe@gmx.de</a> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hello list,<br><br>i am using GRASS 6.4svn to merge adjacent poylgons into larger units.<br>The merging is controlled by a column of type CHAR:<br>
<br>v.dissolve input=counties output=counties_merged_fips1 column=FIPS_1<br><br><br>results in dbmi: Protocol error ERROR: Cannot open select cursor:<br>SELECT cat, FIPS_1 FROM counties ORDER BY FIPS_1 ERROR: Unable to<br>
open vector map <counties_fips1_22157@admin_borders> on topology<br>level 2 WARNING: Table <counties_fips1_22157> linked to vector map <counties_fips1_22157> does not exist ERROR: Vector map<br><counties_fips1> not found in the current mapset<br>
<br>v.dissolve works correctly when applied to an INT column.<br><br>I assume this is a bugfeature - <br></blockquote><br></span>v.dissolve is only a frontend script to v.reclass which needs ints...<span class="q"><br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">string-based dissolving would be<br>great to have at some point.<br></blockquote><br></span>+1<span class="q"><br>
<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>For now, does anybody have a (DBdriver-)SQL-hack to transmogrify<br>strings like "GRASS001", "GRASS002", "GRASS003" into the Integers<br>
1,2,3 ? (aka getting rid of the "GRASS"-part of the string) ?<br></blockquote><br></span>If you absolutely need to work with the dbf-driver, then I guess you best bet would be to open the dbf file in OpenOffice Calc and use its functions.<br>
<br>If you can switch over to SQLite, I think the ltrim function should do what you need.<br><br>More full-fledged SQL-backends obviously have more sophisticated functions.<br><span class="sg"><br>Moritz</span>
<div><span class="e" id="q_11b98779aada4e66_7"><br>_______________________________________________<br>grass-user mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br></span></div></blockquote></div>
<br>