[GRASS-user] grass command to subset the columns of a vector

Markus Neteler neteler at osgeo.org
Wed Feb 9 00:27:54 PST 2022


Hi Bernardo,

On Wed, Feb 9, 2022 at 1:39 AM Bernardo Santos via grass-user
<grass-user at lists.osgeo.org> wrote:
>
> Dear list,
>
> Is there a GRASS GIS command (maybe a v.db.* one) to subset, in a single command, the columns of a vector?
>
> What I have: vector "vect" with 5 columns "a, b, c, d, e" in the attribute table
> What I want: vector "vect_sub" with only, for instance, "a, c, e"
>
> I can use v.extract to subsample rows, but not columns. What is the easiest way of doing that, what needing many commands (like creating or copying the vector to a new one, creating a new attribute table, then copying only the columns I want).

Isn't this simply

https://grass.osgeo.org/grass80/manuals/vector.html
--> v.db.dropcolumn - Drops a column from the attribute table
connected to a given vector map.
    --> It offers single and multiple column dropping: columns=name[,name,...]

> I looked for that in the documentation but did not found it so easily.

Please suggest where to improve the documentation.

Markus


More information about the grass-user mailing list