PDF version of this page

Area, Field and Rule Properties

Areas contain Fields and are defined by Rules on those Fields.

This section show how to modify areas, add and modify fields within the areas and how to set and modify rules on fields to recognize the area.

Adding New Fields

These are the Field icons.

Field Toolbar

Select New field, this gives an I-Bar cursor I-Bar Cursor, press mouse and drag over the data that forms a field, let go to define the field.

I-Bar on page

This window opens, give the field a Name.

Data field definition 

Add exact match rule

Closing the window and selecting the field shows its name (in yellow, above the field).

Right click on the field, and select as shown to make this a "Rule".

This rule requires an "Exact match" with the highlighted field. All Rules within an area must be true to recognize an area. Rule fields are shown in Green rather than yellow.

                 Page Highlighted Green

You can "lock into" field generation by pressing the I-Bar icon Ibar Icon which allows continual generation of new fields until turned off.

Top

Selecting Area, Field or Rule for Edit


Modify areas properties, Fields and Rules via Edit, Properties icon with a field or area selected ....


... or by selecting a field or rule and the icon from the Document window ...







... or by pressing Mouse Right from the (data) screen ...

        ... which opens an options list.




Properties of selected field ... is greyed unless exactly one field is selected.

        Press HERE to see how to modify an individual field.

        ... or HERE to see how to modify an individual rule.

Top

Area Properties

Data extraction area This is the Area properties window.


You can add a new field, edit or remove a field from this list.

  • Name (of the area) may be changed - except the master area.
  • Height is the number of lines included in this area.
  • Options apply to areas - except the master area.
  • Header comment on master record is a tick box that defines this as a master comment. We had to include this for files where Master Comments and Product Comments cannot be separated.






This is the Options pull-down.






Ends record means this field finalizes a record. Use this for the last line of multi-area records (product description KICKPLATE in these examples):

  • No optional lines.
  • Two lines, ending with KICKPLATE
  • Four optional lines.
  • Six lines, ending with KICKPLATE

Field Merging Options



Repetitive concatenates adjacent lines in input into one field, and opens Field Merging with these choices for the inter-line spacing in the merged field:

Top

Field tab of Area Properties




The Field tab of the Area windows shows fields. Add, Edit or Remove buttons are available, Edit modifies the selected field.


Field properties are entered or edited through this window.

Normalize is the named RegEx used to reformat input data to the XML field. Predefined expressions are provided in the Search and replace pull-down (and you can include your own expressions).

                 

Data is normalized in the output XML file. The common normalizations are:

Remove leading zeroes - used for records mode raw data - removes leading spaces and zeroes - retains one zero if the field is all zero.
Remove superflous white space - used to remove leading, trailing and internal multiple spaces (leaving one internal space).
Trim numeric - used to trim spaces from numerics, including substitution of 0 if the field is empty.
Trim - trims leading and trailing spaces from the data - use for text data to avoid doing this at form design time. This is required for fields used as substitutions.

Comments on RegEx
Additional RegEx Expressions

Note: FormTrap does NOT support RegEx under the Support and Upgrades contract, help with or generation of custom RegEx expression is chargeable. New expressions may be added from time to time by FormTrap.

A list of RegEx expressions (updated from time to time by FormTrap) can be viewed here.





Case Normalization modifies fields as shown:  


 




Parser, Type defines data content and defaults to Text. Number, Currency, Percent and Date recognize data and require Pattern. Pattern defines what the data parser looks for.



For Date, select from the pull-down or enter your own pattern to define how the input date (or time) is formatted, these are to Microsoft standards.

Other characters (for example, slashes) are checked on input and output, so must be correct.



d one or two digit day
dd two digit day
M one or two digit month
MM two digit month
MMM Month three character literal in Locale notation, case does not matter - eg Jun
MMMM Full month literal in Locale notation, case does not matter - eg June
yy Two digit year
yyyy four digit year


Number Pattern may be chosen or a new pattern entered. Standard representation is a leading number, or leading minus character plus number where negative. This requires just the left entry in the list.

Any other representation requires either selection of Normalize, Negative number or you must use an entry with BOTH left-positive and right-negative, semi-colon separated (as shown) in this list. Embedded thousand separators must be shown if the number comes in that way.

Position for the sign must be correct in respect of spaces before the sign (trailing sign) or after the sign (leading sign).

The last pattern used for this form is suggested next time as most files are consistent in their data representation.

Top

Rule tab of Area Properties

Rules window
Rules tab within Rules and other area properties provides Add, Edit, and Remove rules. Add and Edit open the Rule window.

Rule type: has several alternatives:

Rule type: Exactly matches is the most common selection and is included as a choice when mouse right is clicked on a single field.

                

  • Related field opens a pull-down showing sorted field names, chose the one to test.
  • Match (evaluate) what shows the comparison value. This MAY NOT be an expression (use Rule type: Matches regex expression if an expression is required).
  • Ignore case ticked does a comparison ignoring capital letters, ie HELLO, Hello and hello all compare as equals.
  • Apply NOT to result of matching ticked is a "not equal" comparison.





Rule type: Contains is similar to Exactly matches but does the comparison anywhere in the field. Match (evaluate) what shows the comparison value.  An expression MAY NOT be entered (use Rule type: Matches regex expression if an expression is required).

Rule type: Is empty tests for the absence of data (line feeds, etc. are ignored).

Rule type: Matches regex expression provides a Wizard to select or key in the RegEx expression.

Rule type: Evaluates numeric expression to true or non zero allows entry of a muParser expression.

From Version 8-20 for Rule type: Exactly matches, you may leave Match (evaluate) what "empty" to indicate the field is beyond the end of the line, allowing the length of the line to be tested.  Ticking Apply NOT to result of matching indicates the field is included before the line end.



Rule type: Matches regex expression, press the Wizard button.


The Match pull down shows rule expressions. Normally you will want to modify something like Contains either one of two to match what you require (this expression is common for different document names of the same format). You would normally choose Add (copy) ... to modify and create a new expression.

Below shows the "after" of generating a new RegEx expression from the list via Add (copy)... that identifies different types of Invoice documents from their titles.

Top