Replace method of the
Regex class can be used to match positive, negative or decimal numbers and modify any hit with something more appropriate via a delegate. The regular expression and the delegate can be modified to suit any specific needs. In the example below, the double quotes from numeric values is removed. The regular expression used can match positive, negative, integers or decimal numbers.
A similar approach can be used in case of larger files with the help of
A test using a 24MB file containing 250000 records as in the example above (see first code snippet original vs modified) completed in 2.5 seconds on my development machine (quad core i5 2.00GHz, 16GB RAM).