Skip to content

Changing Column Content

CadnaA offers comfortable features for the editing of specified ranges of tables on the basis of the current value. This can be either a conversion of numerical values (arithmetics) or a modification (substitution) of strings.

For the examples below, you should open a table – for example the table of point sources – of a CadnaA project, or just enter a few points and open the respective table of object.

Click the column to be edited using the right mouse button. On the context menu, select Change Column.

Range of Rows

On the dialog, the range of rows can be restricted to upwards or downwards, starting from the current row. By default, range of rows covers all elements of the selected column.

If the column contains numerical values, both „arithmetic“ and „string“ conversions are possible. In all other cases, only string conversion is possible.

Arithmetic

The current numerical value may be replaced by a different constant value, or by one that is computed from the current value.

+, -, /, * are operators used as customary. x stands for the current value.

++ and -- stand for level addition and subtraction.

For all operators and examples see the CadnaA manual „Attributes, Variables, and Keywords“.

Replace Strings

This operation may be required if a data record, e.g. the CadnaA project for an enterprise, is to be embedded in larger limits, requiring modification of the ID.

Find what

Specify a search string in the box Search For: only strings matching this string will be converted.

The characters * (asterisk: arbitrary number of arbitrary characters) and ? (questions mark: one arbitrary character) act as wild cards used as customary. If sections of a string are to be reused in the conversion, these are enclosed in brackets.

Replace with

In the box „Replace with“ you may combine arbitrary character strings with the string sections marked by brackets in the search string. \1...\n is used as a symbol for these marked string sections (see CadnaA manual "Attributes, Variables, and Keywords").

Automatic Numbering in Tables

With the hash sign # you can number automatically a column in a tables. One hash # results in a one digit value from 1 to 9, two hashes ## result in a two digit value from 01 to 99, three hashes result in a three digit value from 001 to 999 and so on. After the value 9 CadnaA starts with 0 again.

Starting Number

Definition of the number, at which the numbering with # should start

Enter the hash in the field „Replace with“.

Example

How to find out how many buildings, barriers, point sources, etc. are in the project without having to count them individually?

Here is the answer:

Example

Path: Examples\Demo1.cna

  • Open the file DEMO1.CNA and open the table „Building“.

Existing table „Building“ - initial situation

  • Position the mouse pointer on the column „Name“.
  • Click it using the right mouse button and select Change Column on the context menu.
  • Specify the settings as shown in the figure below.

Automatic numbering with the function Change Column

The figure shows automatic numbering using two digit. The string \1 means that the current value is to be retained. In this example, however, the column is empty. Add the name „Building“. The string ### generates a 3-digit automatic numbering (with increasing figures). With 2 hashes in stead, a 2-digit numbering would occur. In case there are more than 99 objects, the 100th object will receive a 00 (zero-zero) and the 101st object the number 01.

Result of the automatic numbering

Thus, this command enables to determine the number of objects in a project file.

In order to remove the string part, use the command Change Column from the context menu. Apply the settings as shown below.

Setting to remove the string part from the previous example

The numbering is kept, the string in front of it, however, is deleted. \2 means that the first string in brackets is preserved.

In order to delete the entire column content, enter an asterisk * in box „Find what“ and in box „Replace with“ nothing (so, remaining empty).