I have recently needed to have text comparisons ignore certain columns of text as unimportant. In my specific case, these are columns that contain addresses in symbol dumps or map file for executable binaries. Essentially, I didn't care if a symbol was located at a different address, I was interested in finding new or removed symbols.
I have been able to perform this work with the current BC feature set by doing one of the following:
- use a regex to indicate a column is unimportant. This works when the column(s) I want to ignore are at the beginning of the line or if the information in the column I want to ignore can be uniquely identified by a regex.
- use a text editor to remove the column, and compare those modified files
However, I'd prefer to be able to simply tell BC something like: ignore columns 1-8 and 24-31
I imagine this could possibly be implemented by mechanically converting the column specification to a regex, though I honestly don't know what that transform would be.
I have been able to perform this work with the current BC feature set by doing one of the following:
- use a regex to indicate a column is unimportant. This works when the column(s) I want to ignore are at the beginning of the line or if the information in the column I want to ignore can be uniquely identified by a regex.
- use a text editor to remove the column, and compare those modified files
However, I'd prefer to be able to simply tell BC something like: ignore columns 1-8 and 24-31
I imagine this could possibly be implemented by mechanically converting the column specification to a regex, though I honestly don't know what that transform would be.
Comment