Skip to content

Instantly share code, notes, and snippets.

@tomoya
Created October 30, 2012 16:15
Show Gist options
  • Select an option

  • Save tomoya/3981242 to your computer and use it in GitHub Desktop.

Select an option

Save tomoya/3981242 to your computer and use it in GitHub Desktop.
ぽんとさんのために作りました
;; このようなデータを
;; 532101 18 19
;; 532102 19 20
;; ↓
;; 532101 18 19 1.0555555555555556
;; 532102 19 20 1.0526315789473684
;; このようにします
(defun ponto-special (start end)
(interactive "r")
(replace-regexp "^\\(.* \\)\\([0-9]+\\) \\([0-9]+\\)"
(query-replace-compile-replacement "\\1\\2 \\3 \\,(/ (string-to-int \\3) (string-to-int \\2))" t)
nil start end))
(provide 'ponto-special)
@elim

elim commented Oct 30, 2012

Copy link
Copy Markdown

なんて specific な。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment