good idea, I may be able to make that work.
The issue is that my file is several MB and the VAST majority of lines will not match - so I'd like to check for a match before wasting the processing time to remove whitespace.
Also I need to remember the original string (with spaces) as I need to put it back as it was (after changing a couple things)
| [reply] |
With regard to the first paragraph, I would say that “this consideration is of non consequence,” because the computer can perform the operation in a few nanoseconds using a single regex.
With regard to the second one, however, there could be a bit more of a problem, because when you do go about designing the code to “change a couple things,” you will perhaps need to be extremely careful to design the algorithm to always change the right things and to do so consistently in all cases.
Nevertheless, each of these concerns are basically independent of one another, and therefore I would proceed in this course. Removing the white space will allow you to use a regex efficiently to winnow out the lines-of-interest wheat among millions-of-lines of chaff, and that alone is enough.
| |