[Utils] Small helper function to open CSV files as Org mode tables

This commit is contained in:
Daniel - 2019-05-05 15:54:16 +02:00
parent cbe330346c
commit 5b5bf87976
Signed by: dbo
GPG Key ID: 4F63DB96D45AA9C6
1 changed files with 11 additions and 0 deletions

View File

@ -410,6 +410,17 @@ path."
(replace-match "\\1CLOCK: [\\4]--[\\3]")
(org-clock-update-time-maybe)))))
(defun db/find-csv-in-org (arg)
"Interactively CSV find file and open it as Org mode table.
Default separator is \";\", but this can be changed interactively
by passing a universal argument."
(interactive "P")
(let ((separator (if arg (read-from-minibuffer "Separator (regular expression): ")
";")))
(call-interactively #'find-file)
(org-mode)
(org-table-convert-region (point-min) (point-max) separator)))
;;; Calendar