English

How To: Edit a Grid value attribute table (VAT)

Summary

Instructions provided describe how to modify the values in a value attribute table (VAT) with the Tables environment.

Warning:
ESRI does not support altering the Value or Count fields in the VAT. Doing so may give unpredictable results, including corrupting the Grid.

Procedure

Examine the usages and documentation for each of the commands listed below for further information on them.

  1. Access the Tables environment:

      Grid: arc tables

  2. Select the VAT:

      Tables: select grd1.vat

  3. To view the values in the VAT, use the LIST command:

      Tables: list
    Record VALUE COUNT
    1 -7 2
    2 -4 3
    3 -2 1
    4 -1 1
    5 0 6
    6 1 11
    7 2 3
    8 3 7

  4. To view the item types, use the ITEMS command:

      Tables: items
    COLUMN ITEM NAME WIDTH OUTPUT TYPE N.DEC ALTERNATE NAME INDEXED?
    1 VALUE 4 10 B - Indexed
    5 COUNT 4 10 B - -

  5. To add a new field, use the ITEM command. The item types are:
    'i' for integer, 'b' for numerical number type, 'c' for character, and 'f' for float (also need to specify the number of decimal places). See article 30447 for more details on the item types.

      Tables: additem grd1.vat new_item1 2 3 i
    Tables: additem grd1.vat new_item2 3 4 c

    Note: use 'i' for integer, 'b' for binary number type, 'c' for character, and 'f' for float (also need to specify the number of decimal places).

  6. To add all items to the selection, use ASELECT:

      Tables: asel
    8 Records Selected.

    All items are selected by default.

  7. To remove items from the selection, use NSELECT:

      Tables: nsel
    0 Records Selected.

  8. To select a single record, use ASELECT with the {logical_expression} option:

      Tables: asel value = -4
    1 Records Selected.
    Tables: list
    Record VALUE COUNT NEW_ITEM1 NEW_ITEM2
    2 -4 3 0

  9. A range of records can also be selected with the {logical_expression}:

      Tables: asel value < 0
    4 Records Selected.
    Tables: list
    Record VALUE COUNT NEW_ITEM1 NEW_ITEM2
    1 -7 2 0
    2 -4 3 0
    3 -2 1 0
    4 -1 1 0

  10. To assign numerical values to the selection, use the CALCULATE command:

      Tables: calc new_item1 = 1
    Tables: list
    Record VALUE COUNT NEW_ITEM1 NEW_ITEM2
    1 -7 2 1
    2 -4 3 1
    3 -2 1 1
    4 -1 1 1

  11. To assign character values to the selection, put the string in single quotes:

      Tables: calc new_item2 = 'neg'
    Tables: list
    Record VALUE COUNT NEW_ITEM1 NEW_ITEM1
    1 -7 2 1 neg
    2 -4 3 1 neg
    3 -2 1 1 neg
    4 -1 1 1 neg

  12. To continue with this example, the remaining values will be set to a numerical value of '2' and the associated string field to 'neg':

      Tables: asel
    8 Records Selected.
    Tables: nsel
    0 Records Selected.
    Tables: asel value >= 0
    4 Records Selected.
    Tables: calc new_item2 = 2
    Tables: calc new_item1 = 'pos'
    Tables: asel
    Tables: list
    Record VALUE COUNT NEW_ITEM1 NEW_ITEM2
    1 -7 2 1 neg
    2 -4 3 1 neg
    3 -2 1 1 neg
    4 -1 1 1 neg
    5 0 6 2 pos
    6 1 11 2 pos
    7 2 3 2 pos
    8 3 7 2 pos

Related Information