[GRASSLIST:9301] Re: number of rows in a table?

Kirk R. Wythers kwythers at umn.edu
Mon Dec 5 12:00:37 EST 2005


Thanks for the suggestion. However, the command gives a DBF driver  
error:

GRASS 6.1.cvs (arrowhead_utm):~ > echo "select count(*) from  
allspecies83" | db.select
DBMI-DBF driver error:
SQL parser error in statement:
select count(*) from allspecies83

Error in db_open_select_cursor()

GRASS 6.1.cvs (arrowhead_utm):~ >

Am I missing something here?

Kirk


On Dec 4, 2005, at 1:59 PM, Dylan Beaudette wrote:

> On Dec 4, 2005, at 7:24 AM, Kirk Wythers wrote:
>
>> I need to find the number of rows in a table. I have some vector  
>> files that crash qgis, yet grass opens them fine. Looking at the  
>> dbf files, I suspect the the issue is the file size (20 - 30 MB).  
>> I wanted to check the number of rows and I've been looking through  
>> the db commands, unfortunately, so far all I have come across is  
>> using using db.describe to get the number of columns. Any  
>> suggestions?
>>
>> Thanks,
>>
>> Kirk
>>
>>
>
>
> try this
>
> echo "select count(*) from table" | db.select
>
> this should return the number of rows in table.
>
> Cheers,
>
>
> --
> Dylan Beaudette
> Soils and Biogeochemistry Graduate Group
> University of California at Davis
> 530.754.7341
>




More information about the grass-user mailing list