notepad++ regex replace

Problem: I have a file with many variable length lines with a decimal number on the end (i.e. a transaction statement that was not formatted very well) and I needed to extract just the decimal value on the end.

Solution: I used the regular expression replace feature in Notepad++. The regular expression is some like "for each line match the decimal number at the end). The magic part is on the Replace with field I needed \1 to replace each line with just the matched section. I could probably have expanded on this to retain all the values and put tab separators in so it could copy and paste it into excel!

No comments:

Post a Comment