;csv: doc: use field matchers in manual examples
[ci skip]
This commit is contained in:
		
							parent
							
								
									d537f1fe07
								
							
						
					
					
						commit
						99aec9d476
					
				| @ -175,10 +175,7 @@ amount2     %amzamount | |||||||
| #include categorisation.rules | #include categorisation.rules | ||||||
| 
 | 
 | ||||||
| # add a third posting for fees, but only if they are non-zero. | # add a third posting for fees, but only if they are non-zero. | ||||||
| # Commas in the data makes counting fields hard, so count from the right instead. | if %fees [1-9] | ||||||
| # (Regex translation: "a field containing a non-zero dollar amount, |  | ||||||
| # immediately before the 1 right-most fields") |  | ||||||
| if ,\$[1-9][.0-9]+(,[^,]*){1}$ |  | ||||||
|  account3    expenses:fees |  account3    expenses:fees | ||||||
|  amount3     %fees |  amount3     %fees | ||||||
| ``` | ``` | ||||||
| @ -262,9 +259,8 @@ amount1  %netamount | |||||||
| # (account2 is set below) | # (account2 is set below) | ||||||
| amount2  -%grossamount | amount2  -%grossamount | ||||||
| 
 | 
 | ||||||
| # if there's a fee (9th field), add a third posting for the money taken by paypal. | # if there's a fee, add a third posting for the money taken by paypal. | ||||||
| # TODO: This regexp fails when fields contain a comma (generates a third posting with zero amount) | if %feeamount [1-9] | ||||||
| if ^([^,]+,){8}[^0] |  | ||||||
|  account3 expenses:banking:paypal |  account3 expenses:banking:paypal | ||||||
|  amount3  -%feeamount |  amount3  -%feeamount | ||||||
|  comment3 business: |  comment3 business: | ||||||
| @ -272,11 +268,11 @@ if ^([^,]+,){8}[^0] | |||||||
| # choose an account for the second posting | # choose an account for the second posting | ||||||
| 
 | 
 | ||||||
| # override the default account names: | # override the default account names: | ||||||
| # if amount (8th field) is positive, it's income (a debit) | # if the amount is positive, it's income (a debit) | ||||||
| if ^([^,]+,){7}[0-9] | if %grossamount ^[^-] | ||||||
|  account2 income:unknown |  account2 income:unknown | ||||||
| # if negative, it's an expense (a credit) | # if negative, it's an expense (a credit) | ||||||
| if ^([^,]+,){7}- | if %grossamount ^- | ||||||
|  account2 expenses:unknown |  account2 expenses:unknown | ||||||
| 
 | 
 | ||||||
| # apply common rules for setting account2 & other tweaks | # apply common rules for setting account2 & other tweaks | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user