If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
Possibly. You could set up a grammar item for numbers that doesn't include leading 0's and then another grammar item to match just the 0's and then ignore them. It will be more complicated if you're trying to modify one of our default file formats with an existing grammar.
* Load the files in the text compare.
* Click the "Format" button on the toolbar (Paper with a Gear).
* Switch to the "Grammar" tab.
* Click "New...".
* In the new dialog
- Change the "Element name" to "Number".
- In the "Text matching:" edit enter "([1-9]+(\.[0-9]*)?|\.[0-9]*" without quotes.
- Check the "Regular expression" checkbox.
- Click OK.
* Click "New..." again.
* In the new dialog
- In the "Element Name" edit type "Leading zeros"
- In the "Text matching:" edit enter "0+".
- Check the "Regular expression" checkbox.
- Click OK.
* Click OK.
* Click the "Rules" button on the toolbar (Umpire).
* Uncheck the checkbox next to "Leading zeros" in the "Grammar elements" list.
* (Optional) Change the combobox at the bottom of the dialog from "Use for this view only" to "Update session defaults".
Possibly. You could set up a grammar item for numbers that doesn't include leading 0's and then another grammar item to match just the 0's and then ignore them. It will be more complicated if you're trying to modify one of our default file formats with an existing grammar.
* Load the files in the text compare.
* Click the "Format" button on the toolbar (Paper with a Gear).
* Switch to the "Grammar" tab.
* Click "New...".
* In the new dialog
- Change the "Element name" to "Number".
- In the "Text matching:" edit enter "([1-9]+(\.[0-9]*)?|\.[0-9]*" without quotes.
- Check the "Regular expression" checkbox.
- Click OK.
* Click "New..." again.
* In the new dialog
- In the "Element Name" edit type "Leading zeros"
- In the "Text matching:" edit enter "0+".
- Check the "Regular expression" checkbox.
- Click OK.
* Click OK.
* Click the "Rules" button on the toolbar (Umpire).
* Uncheck the checkbox next to "Leading zeros" in the "Grammar elements" list.
* (Optional) Change the combobox at the bottom of the dialog from "Use for this view only" to "Update session defaults".
In addition to this question I have another one.
How can I filter out any numbers with the same value?
Example:
10.0 has same value as 10
12.50 has same value as 12.5
The Text Compare does not have the concept of values. You can define specific text strings to match others, but we do not have an option to match and treat as a numeric. We do have this option in the Data Compare, if your files are delimited information that can be viewed in a table (rows/columns). A Numeric column would find and treat numbers based on their value.
Comment