Skip to content

Replace

Use this dialog to replace values for an attribute in an application layer.

Where to find the dialog?

Right-click in the horizontal list field for the surveying application layer, and select Replace.

Preparations

Before making changes, select the rows in the list you want to modify. Mark the first row, hold [Shift], and mark the last row. To select individual rows, use [Ctrl] (standard Windows functionality).

Procedure

  1. Select objects in the list.
  2. Select Replace... from the context menu.
  3. Select the relevant attribute from the dropdown menu. The program suggests the attribute you clicked on in the horizontal list field.
  4. Enter a value for Find what. * replaces the entire selection.
  5. Enter a value for Replace with. You can replace with text strings or mathematical expressions (function expressions). See examples below for different types of replacements.
  6. Click Replace. The Replace button does not close the dialog. You can quickly enter values for measurement method, accuracy, visibility, measurementMethodHeight, and accuracyHeight without leaving and re-entering the dialog.
  7. Click Close (or x in the upper right corner) to exit the dialog.

Options

  1. Replace the entire string
  2. Replace part of a string
  3. Add postfix and/or prefix
  4. Add to or sum existing content
  5. Retrieve content from another column
  6. Generate numbers P1, P2, P3, etc.

The character * is called a wildcard. Use it to replace one or more letters/numbers. In the Find what field, * only works as the last character.

The fx button activates mathematical mode and inserts =, which means calculation. You can then enter a function expression containing operators and values from multiple attributes, for example =+.

You also have the following advanced option: An extra = means to generate point numbers. For example, 1==+1 gives the following values: 1, 2, 3, 4, 5, etc. This only works when the last part of the string is numeric.

Objects in the application layer have both geometry and properties, and you can change values for some geometry columns (fixed columns) and property columns (defined under metadata).

Example: Replacing geometry

Property Find what Replace with Description
Height * =%Height%*-1 To reverse the sign
Height * =%Height%/10 or =%Height%*0.1 To change the scale
Height * =%Height%-1 Subtracts -1

Example: Replacing properties

Property Find what Replace with Result
ABC BCD ABC123 → BCD123
BC XYZ ABC123 → AXYZ123
* abc ABC123 → abc
* xx%fieldname%yy ABC123 → xxABC123yy
* %fieldname% Retrieves the content from the field (property)
* %fieldname1%_%fieldname2% Retrieves the content from field 1 and 2 separated by _ (underscore)

Example: Replacing with function expressions

Find what Replace with Description
* =%fieldname%/2 Divides the value in fieldname by 2, e.g., 100/2 → 50
* =%fieldname1%*%fieldname2% Multiplies the value in fieldname1 by fieldname2
* =%fieldname%+1 ABC100 → ABC101
* =%fieldname%+1 ABC100_A → error, last part is not numeric

Example: Replacing with advanced expressions

Find what Replace with Result
* ABC1==+1 gives ABC1, ABC2, ABC3, etc.
* XY1==+100 ABC123 → XY1 and next → XY101
A* XY1==+100 ABC123 → XY1, but BCD123 is omitted
A* BCD==+100 Error, no numeric part before ==
A* QQ+100 ABC123 → QQ+100, + is just a character in this context