Editing Data in Tables

We may edit data in tables interactively by clicking into individual records, by using Find and Replace and by making global edits using the Transform toolbar . Editing data in tables that have been imported into Manifold will change the data only within the Manifold project. Editing data within external tables that have been linked into a project will change the data in the external table.

 

We can change fields in records by double-clicking on the field and entering a new value. Press Enter to apply the new value. If we change our minds after clicking a field, we can hit the Esc key to abandon the edit. Some fields in some databases may be limited to certain values, in which case choice boxes or other dialogs will pop up as necessary to provide allowed choices.

 

For "global" edits that affect an entire column throughout the entire table or selection use the Transform toolbar . Most table editing commands will be accomplished by a series of steps using the transform toolbar.

 

To edit individual records, we can use standard Windows power moves as set forth below:

 

Editing Cells

 

The contents of cells may be edited by double clicking into the cell, by pressing Enter or by clicking on the cell to highlight it (or by moving the highlighting using arrow keys) and pressing F2. When finished editing, press Enter to accept the value or click with the mouse anywhere outside the cell to accept the value.

 

Cells will only accept values that are compatible with the data type of that field. For example, double clicking into an integer field and attempting to enter the value 425 Main Street will result in no changes made on pressing Enter. Attempting to enter a floating point value such as 3.1415 into an integer cell will result in only the integer part of the value (3) being entered on pressing Enter.

 

Cells that are formatted in a given column formatting style will accept edits in any compatible style. For example, if a date and time column is formatted to show dates as 3/09/2001 and one enters 9 mar during the year 2001 the entry will be accepted and shown as 3/09/2001. In this case, Manifold knows that "mar" in date and time fields means March. If the or time is not explicitly given the system uses the current system year and time. To specify all parts of the data and time value, enter explicitly those parts desired. If one enters 9 mar 99 the entry will be accepted and shown as 3/09/1999.

 

Editing the value of a fixed-length text column in a table window limits the length of the editable text to the maximum length accepted by the column.

 

Right clicking onto a cell brings up a context menu of choices. Note that the Delete command will reset the value of the clicked cell to the default value for that column. For example, using Delete on a cell in an integer column will reset the value of that cell to 0.

 

Adding Records to a Table

 

Tables that are associated with drawings cannot have records added to them from the table window since each record in the table is associated with an object in the drawing. Adding a record means adding an object: this is done in either a drawing window or a map window (if the drawing is used as a layer in a map) by inserting a new point, line or area object. When the new object is inserted into the drawing a new record for it will appear in the table.

 

To insert new records into tables that are not associated with drawings, click into cells in the new record row (marked with an asterisk) to edit their values. Press SHIFT-Enter to append the new record to the table.

 

images\tbl_add_record_01.gif

Suppose we start with a table with only two records.

 

images\tbl_add_record_02.gif

If we click on the first empty cell in the new record row and press Enter we can begin entering a new name. In this case, we have typed Ben.

 

images\tbl_add_record_03.gif

Pressing Enter will enter that value into that cell. Note that the status icon in the row handle has changed to a small pencil to show we are entering a new record. We can press the right arrow on the keyboard to move to the next cell in the row.

 

images\tbl_add_record_04.gif

If we press Enter we can begin editing that cell. After entering the text Franklin we can press Enter once more to have the cell accept the new value.

 

images\tbl_add_record_05.gif

 

If we are happy with our new record we can right click on the record handle (editing pencil icon) or on the new cells and choose Append to append the new record to the table. Choosing Cancel will cancel the operation and choosing Clear will clear all values from cells so we can begin again. Keyboard shortcuts: use SHIFT-Enter to append and SHIFT-Backspace to cancel.

 

images\tbl_add_record_06.gif

 

If we append the record a new record is added to the table. Note that the editing pencil icon has been replaced with a current record icon in the usual way. A new record row appears as well.

 

Changing Fields in Many Cells at Once

 

When changing the value of a specific cell, that field will be changed to that value for all selected records:

 

images\ctrl_tv_manyedit01.gif

 

Suppose we wish to change the title to "Sales Person" in all selected records.

 

images\ctrl_tv_manyedit02.gif

 

Press Enter or double click into the field in any of the selected records and enter "Sales Person" and then press Enter.

 

images\ctrl_tv_manyedit03.gif

 

The value will be changed in that field in all of the selected records.

 

This above behavior can be turned off by unchecking the Apply table cell editing to all selected records box in the Tools - Options dialog.

 

Keyboard Editing

 

One may also edit data in Table windows using "keyboard style" data editing. Double-click into a field to edit it and then push Enter. Move the edit box to another field by using the keyboard cursors. Push Enter to open the field for editing, enter the new value, and then hit Enter to apply the value.

 

The Tab key will move one cell to the right of the active cell. A Shift-Tab will jump one cell to the left of the active cell.

 

Keyboard editing is a rapid way of moving the cursor through columns of data and making changes as desired.

 

Finding and Replacing Data

 

Data in tables can be found and, if desired, replaced with the Edit - Find , Edit - Find Next and Edit - Replace dialogs. These are very similar to the analogous dialogs in Microsoft Office applications. See the Finding / Replacing Data topic. For details on options in the Find and Replace dialogs, see the Edit - Find / Find Next and Edit - Replace topics.

 

Note: Manifold Find and Replace operate from the current record position forward to the end of the table. To being a search at the beginning of the table, press the Restart dialog in the Find or Replace dialogs.

 

Copying and Pasting Columns

 

Entire columns of data may be copied and pasted or copied and appended as new columns into tables.

 

images\sc_table_column_copy_paste_01.gif

 

Consider a table containing columns of data like the above. We would like to copy the contents of the SQMI column and paste it into another column. To do so, we first right click onto the column head for the SQMI column.

 

images\sc_table_column_copy_paste_02.gif

 

In the resulting context menu, we choose Copy.

 

images\sc_table_column_copy_paste_03.gif

 

Suppose we would like to paste the contents into the Square Miles column: we right click that column header…

 

images\sc_table_column_copy_paste_04.gif

 

… and in the resulting context menu we choose Paste.

 

images\sc_table_column_copy_paste_05.gif

 

The values from the SQMI column will be pasted into the Square Miles column.

 

images\sc_table_column_copy_paste_06.gif

 

Suppose that instead of choosing Paste in the context menu, we had right clicked onto Square Miles and had chosen Paste Append?

 

images\sc_table_column_copy_paste_07.gif

 

In that case, a new column called SQMI 2 would have been created and the values from the SQMI column would have been pasted into that new column.

 

The above example shows copy and paste within the same table; however, Manifold also supports copy and paste of binary data in table columns through the Windows clipboard when other applications are used. For example, we can copy a column from an Excel spreadsheet and paste it into a Manifold table column.

 

Using Regular Expressions

 

Regular expressions are a concise and flexible notation for finding and replacing patterns of text and are used in the Find and Replace dialogs.

 

See the Regular expressions topic for information on using regular expressions. These are a much more sophisticated and flexible method than simply using the * and ? characters.

 

Tech Tip: Changing Ordinary Fields in Tables does not Move Objects

 

The positions of objects in drawings are embedded within the geometry of the drawing without need to have latitude and longitude values listed in a table. Sometimes we create drawings from geocoded tables that have a latitude and longitude for each record. We might wish to have the latitudes and longitudes that were used to position the points immediately at hand in the drawing's table and so when pasting the geocoded table as a drawing we may tell Manifold to bring along the latitude and longitude fields along with the other fields.

 

Whatever the motive or process that was used to create a drawing, it is often the case that "latitude" and "longitude" numbers will be copied to fields in a table as well as being embedded within the geometry of a drawing. GIS beginners often mistakenly think that the positions of items in the drawing are determined from the listings of latitude or longitude fields in the table, so that editing these fields will move the objects. That's not the case.

 

We can use intrinsic fields to display in a table the actual latitudes and longitudes of objects associated with records. However, intrinsic fields are special, system-generated fields and are different than "latitude" and "longitude" fields we might bring into a table that are ordinary text or numeric fields. The rest of this topic explains why this is so.

 

Drawings are often created in Manifold from geocoded tables. A geocoded table is a table where each record has latitude and longitude fields that specify the location of that record.

 

Suppose we have an Access database that contains a list of towns together with their latitude and longitude coordinates:

 

images\sc_tv_editcoords01.gif

 

We can import this Access table into a table in Manifold [either by importing the data or by linking to the external table]:

 

images\sc_tv_editcoords03.gif

 

To create a drawing from this table we use Edit - Copy to copy the table and then we use Edit - Paste As - Drawing in the project pane to create a new drawing based on the data in the table. Each geocoded record will appear as a point in the drawing.

 

images\sc_tv_editcoords02.gif

 

We can combine this new drawing in a map together with a base map of the United States to see at a glance where the various points are located

 

When we use the Edit - Paste As - Drawing command to create a new drawing, Manifold will automatically create the associated data attribute table for that drawing. By default, that new table will have at least one field, the object ID field. During the Paste As operation Manifold will give us the option of copying additional fields from the original table into the new data attribute table for the drawing. The dialog presents a list of check boxes for each field in the original table. We can copy any of the fields we desire.

 

For example, if our geocoded table is a list of customer records containing fields such as name, address, city, state, and so forth together with a latitude and longitude for each record, we might wish to copy the name, address and other informational fields. There is no particular technical reason to copy the latitude and longitude fields (these fields in the original table will be used automatically to position the points in the drawing for each record) but we can do so if for some reason we want to have this information in the table.

 

If we do copy the latitude and longitude fields into a table associated with the drawing, we will see them in the table window when the table is opened. It is very important to realize that these are just table fields that were copied from the original table. They are not a "handle" into the geometric coordinates that define the position of the points within the drawing's internal structure. Altering the values will not move the points, nor are the fields even necessary to keep the points "positioned" at the right spots.

 

images\sc_tv_editcoords04.gif

 

For example, in the Table window we could delete the "Longitude" field.

 

images\sc_tv_editcoords05.gif

 

We could delete the "Latitude" field as well. If we do so the points do not magically disappear from the drawing. They will still be there. All that we have done is delete a field from the data table associated with the drawing. The points in the drawing have already been created when Manifold read the original database. Changing the text data in the table (either the original one or the new table created with the drawing) changes nothing about those points and does not alter the coordinate numbers inside the drawing.

 

The above discussion may seem obvious to experienced GIS users; however, for new users it is easy to look at a table full of records with latitude and longitudes and to forget that changing the values in the table does not actually move the points about.

 

Changing the Location of Points

 

How then can we change the actual location of points? There are three main ways:

 

·      We can show the Latitude and Longitude intrinsic fields and then change their values. See Editing Intrinsic Fields in Tables . This is the best method when points must be moved to given coordinates.

·      We can right click on individual points in the drawing and use the Object - Coordinates dialog to change the location of the geometric coordinates that define the points. This is a seriously tedious approach.

·      We can use any one of a wide variety of interactive editing tools in a map or drawing window to move the points by selecting them and dragging them to a new location.

 

Note that neither of the above options will change the contents of any "latitude" or "longitude" text fields we might see in a table window.

 

Specifying Languages for Columns

 

Language specification in text columns varies depending on whether Unicode or ANSI text is used. Unicode text columns can simultaneously contain characters from more than one language. ANSI text columns are usually restricted to one language in addition to (possibly) English. Character data contained in an ANSI text column will be interpreted by the system according to the code page associated with that column.

 

By default, ANSI text columns use the system code page. If desired, any ANSI text column in a table can be set to use a different code page by right clicking on the column head and choosing Language.

 

images\sc_column_language.gif