;csv: doc: subheadings
This commit is contained in:
parent
bdc735fa3b
commit
0489622a3f
@ -540,6 +540,8 @@ Conditional blocks ("if blocks") are a block of rules that are applied
|
|||||||
only to CSV records which match certain patterns. They are often used
|
only to CSV records which match certain patterns. They are often used
|
||||||
for customising account names based on transaction descriptions.
|
for customising account names based on transaction descriptions.
|
||||||
|
|
||||||
|
### Matching the whole record
|
||||||
|
|
||||||
Each MATCHER can be a record matcher, which looks like this:
|
Each MATCHER can be a record matcher, which looks like this:
|
||||||
```rules
|
```rules
|
||||||
REGEX
|
REGEX
|
||||||
@ -557,6 +559,8 @@ with any enclosing double quotes (but not enclosing whitespace) removed, and alw
|
|||||||
Eg, if the original record is `2020-01-01; "Acme, Inc."; 1,000`,
|
Eg, if the original record is `2020-01-01; "Acme, Inc."; 1,000`,
|
||||||
the REGEX will actually see `2020-01-01,Acme, Inc., 1,000`).
|
the REGEX will actually see `2020-01-01,Acme, Inc., 1,000`).
|
||||||
|
|
||||||
|
### Matching individual fields
|
||||||
|
|
||||||
Or, MATCHER can be a field matcher, like this:
|
Or, MATCHER can be a field matcher, like this:
|
||||||
```rules
|
```rules
|
||||||
%CSVFIELD REGEX
|
%CSVFIELD REGEX
|
||||||
@ -564,6 +568,8 @@ Or, MATCHER can be a field matcher, like this:
|
|||||||
which matches just the content of a particular CSV field.
|
which matches just the content of a particular CSV field.
|
||||||
CSVFIELD is a percent sign followed by the field's name or column number, like `%date` or `%1`.
|
CSVFIELD is a percent sign followed by the field's name or column number, like `%date` or `%1`.
|
||||||
|
|
||||||
|
### Combining matchers
|
||||||
|
|
||||||
A single matcher can be written on the same line as the "if";
|
A single matcher can be written on the same line as the "if";
|
||||||
or multiple matchers can be written on the following lines, non-indented.
|
or multiple matchers can be written on the following lines, non-indented.
|
||||||
Multiple matchers are OR'd (any one of them can match), unless one begins with
|
Multiple matchers are OR'd (any one of them can match), unless one begins with
|
||||||
@ -576,6 +582,8 @@ MATCHER
|
|||||||
RULE
|
RULE
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Rules applied on successful match
|
||||||
|
|
||||||
After the patterns there should be one or more rules to apply, all
|
After the patterns there should be one or more rules to apply, all
|
||||||
indented by at least one space. Three kinds of rule are allowed in
|
indented by at least one space. Three kinds of rule are allowed in
|
||||||
conditional blocks:
|
conditional blocks:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user