I have a proprietary ansi-text file format with ending ".tab" which uses decimal, float and hex numbers in standard C-Syntax:
(\d+(\.\d+)?(e[+-]?\d+)?)|(0x[a-f\d]+)
The files I have to compare are the result of different work flows, so sometimes there are different numbers of leading zeros, sometimes different numbers of trailing zeros after decimal separators.
I want to compare the logical values of the numbers ignoring the additional zeros. So I need a solution to ignore zeros in the following cases:
For case 1 I have the solution to define a comment rule:
Identical text to: x0*
This works only, until I define a numbers-rule as for C-Files:
(\d+(\.\d+)?(e[+-]?\d+)?)|(0x[a-f\d]+)
When the numbers rule is defined 0x3<=>0x03 is always an important error.
This seemed to be independent from sequence of the rules definitions and may be a BUG.
In case 2 I had tested the following comment-rule:
Identical text to: \.\d*0+[\s,Ee])
The result ignores more than intended, because all from decimal point is now a comment (0.30<=>0.50 result: no important difference). I haven't found a way to define comments (or ignored strings) by limiting literals outside the comment.
Case 3 may be solved in a similar way like case 1.
With case 4 I m expecting the same problem as for case 2 (compare -04<=>+04).
I have already played around with replacement at session settings but without success.
using BC v3.1.4 - build 10554 - pro edition evaluation - german
(testing before upgrade from BC2)
(\d+(\.\d+)?(e[+-]?\d+)?)|(0x[a-f\d]+)
The files I have to compare are the result of different work flows, so sometimes there are different numbers of leading zeros, sometimes different numbers of trailing zeros after decimal separators.
I want to compare the logical values of the numbers ignoring the additional zeros. So I need a solution to ignore zeros in the following cases:
- zeros after "0x" (0x1 <=> 0x0001)
- on floats trailing zeros after decimal separator, before exponent (2.20 <=>2.2)
- leading zeros on decimals and floats (0003<=>3 or 03.3<=>3.3)
- zeros after [+-] (-4<=>-04 or 4E+04<=>4E+4)
For case 1 I have the solution to define a comment rule:
Identical text to: x0*
This works only, until I define a numbers-rule as for C-Files:
(\d+(\.\d+)?(e[+-]?\d+)?)|(0x[a-f\d]+)
When the numbers rule is defined 0x3<=>0x03 is always an important error.
This seemed to be independent from sequence of the rules definitions and may be a BUG.
In case 2 I had tested the following comment-rule:
Identical text to: \.\d*0+[\s,Ee])
The result ignores more than intended, because all from decimal point is now a comment (0.30<=>0.50 result: no important difference). I haven't found a way to define comments (or ignored strings) by limiting literals outside the comment.
Case 3 may be solved in a similar way like case 1.
With case 4 I m expecting the same problem as for case 2 (compare -04<=>+04).
I have already played around with replacement at session settings but without success.
using BC v3.1.4 - build 10554 - pro edition evaluation - german
(testing before upgrade from BC2)
Comment