Search and Replace
Source : Alex Schroeder: Diary
I was looking at tabular data on a wiki page:|... | 1 | 6563| 3796| |... | — | |... | 1/3 | 2315| 1259| |... | — | |... | 1/3 | 159| 607| |... | — | |... | 1/3 | 159| 597| |... | — |I wanted to add 56 to some of the values in the third column.Emacs to the rescue: M-C-% to run query-replace-regexp and search for ^\(|[^|]*|[^|]*|[^|0-9]*\)\([0-9]+\) and replace it with \1\,(+ (string-to-number \2) 56)) – I was surprised at how easy it was once I had remembered to use \, in the replacement pattern [..]
le 03.10.12 à 09:05
dans Mind
-
Article précédent - Commenter - Article suivant -