Replace¶
Use this dialog to replace values for an attribute in an application layer.
Where can I find the dialog?¶
Right-click in the horizontal list field for the application layer, and select Replace...
Using the Dialog¶
Before making a change, you must select the objects in the list that you want to modify. Select the first row, hold down [Shift], and select the last row. To select individual objects, use [Ctrl] (standard Windows functionality).
Instructions
- Select objects in the list.
- Choose Replace... from the context menu.
- Select the relevant attribute from the dropdown menu.
The program suggests the attribute you right-clicked in the list field. - Enter a value for Find what.
*replaces the entire selection. The wildcard (*) is used to replace one or more characters, but can only be used at the end of the search string. - Enter a value for Replace with.
You can replace with text strings or mathematical expressions (function expressions).
See the examples below for different types of replacements you can perform. - Click Replace.
The Replace button does not close the dialog, so you can make multiple changes without exiting and re-entering the dialog. - Click Close (or X in the upper right corner) to exit the dialog.
Examples of what you can do
- Replace the entire string or parts of a text string
- Add a prefix and/or suffix
- Add or change existing values
- Retrieve values from other columns
- Generate number sequences (e.g., P1, P2, P3, etc.)
Wildcard (*) and Mathematical Mode¶
- The wildcard () can be used to replace one or more characters in the search string, but only as the last character in Find what*.
- Use the fx button to activate mathematical mode. This inserts
=and allows you to use function expressions with operators and attributes, e.g.,=<attribute1>+<attribute2>. - Double equals signs (==) can be used to generate point numbers. For example,
1==+1gives the values 1, 2, 3, 4, etc.
Changes to Objects¶
Objects in the application layer have both geometry and properties. You can change values for both fixed geometry columns and property columns defined under metadata.
Contract Posts¶
For the attribute S_CONTRACTPOST, values you enter in Find what and Replace with will match both post names that start with or contain the entered value.
Decimals¶
You can use either a period (.) or comma (,) as the decimal separator in function expressions. For example, both 2.1 and 2,1 will give the value 2.1. A decimal comma or period without digits after (e.g., 2. or 2,) is interpreted as the integer 2.
The tables below show some examples of what you can replace.
Geometry¶
| Property | Find what | Replace with | |
|---|---|---|---|
| Height | * | =%Height%*-1 | To reverse the sign |
| Height | * | =%Height%/10 or =%Height%*0.1 | To change the scale |
| Height | * | =%Height%-1 | Subtracts -1 |
Properties¶
| Property | Find what | Replace with | |
|---|---|---|---|
| ABC | BCD | ABC123 -> BCD123 | |
| BC | XYZ | ABC123 -> AXYZ123 | |
| * | abc | ABC123 -> abc | |
| * | xx%fieldname%yy | ABC123 -> xxABC123yy | |
| * | %fieldname% | Retrieves the content from field (property) | |
| * | %fieldname1%_%fieldname2% | Retrieves the content from field 1 and 2 separated by _ (underscore) |
Function Expressions¶
| Property | Find what | Replace with | |
|---|---|---|---|
| * | =%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 |
Advanced Expressions¶
| Property | Find what | Replace with | |
|---|---|---|---|
| * | ABC1==+1 | Gives ABC1, ABC2, ABC3, etc. | |
| * | XY1==+100 | ABC123 -> XY1. Next -> XY101 | |
| A* | XY1==+100 | ABC123 -> XY1. BCD123 is omitted | |
| A* | BCD==+100 | Error, no numeric part before == | |
| A* | QQ+100 | ABC123 -> QQ+100. + is just a character in this context |