From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: org table with datestamp convert to csv and then xlsx or ods: problem Date: Mon, 08 Jan 2018 20:51:34 +0100 Message-ID: <87fu7g3z95.fsf@nicolasgoaziou.fr> References: <87373hzk6z.fsf@mat.ucm.es> <87incc5vvi.fsf@nicolasgoaziou.fr> <877essxx8y.fsf@mat.ucm.es> <87bmi45sm6.fsf@nicolasgoaziou.fr> <87373gxupd.fsf@mat.ucm.es> <87zi5o4cjk.fsf@nicolasgoaziou.fr> <87y3l8wfdt.fsf@mat.ucm.es> <87vagc4ayo.fsf@nicolasgoaziou.fr> <87shbg1fhl.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYdSM-0003zR-Ob for emacs-orgmode@gnu.org; Mon, 08 Jan 2018 14:51:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYdSL-0002UN-OB for emacs-orgmode@gnu.org; Mon, 08 Jan 2018 14:51:38 -0500 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:60727) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eYdSL-0002TL-Hz for emacs-orgmode@gnu.org; Mon, 08 Jan 2018 14:51:37 -0500 Received: from saiph.selenimh (000043010000000000000469.ipv6.commingeshautdebit.fr [IPv6:2a03:a0a0:0:4301::469]) (Authenticated sender: mail@nicolasgoaziou.fr) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 7E09F17209C for ; Mon, 8 Jan 2018 20:51:35 +0100 (CET) Received: from ngz by saiph.selenimh with local (Exim 4.89) (envelope-from ) id 1eYdSI-0001KJ-H0 for emacs-orgmode@gnu.org; Mon, 08 Jan 2018 20:51:34 +0100 In-Reply-To: <87shbg1fhl.fsf@mat.ucm.es> (Uwe Brauer's message of "Mon, 08 Jan 2018 17:29:10 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Uwe Brauer writes: > > Uwe Brauer writes: > > > I have no trouble calling M-x org-table-export RET then choosing a file > > name and forcing my-tbl-to-csv during prompt. > > Hm I had to copy org-export-table into my addons file and > (let* ((formats '("my-tbl-to-csv" "orgtbl-to-csv" "orgtbl-to-tsv" "orgtbl-to-latex" > "orgtbl-to-html" "orgtbl-to-generic" > "orgtbl-to-texinfo" "orgtbl-to-orgtbl" > "orgtbl-to-unicode")) You don't need to. These are only suggestions, the final format needs not matching any item in this list. > It seems that the variable org-table-export-default-format is ignored, a > bug? Not really. See `org-table-export' docstring, last paragraph. > Right, thanks. A last question though. > > I have set > > org-time-stamp-custom-formats to > (" %d.%m.%y " . " %d.%m.%y %a %H:%M ")) > > '(org-time-stamp-custom-formats (quote (" %d.%m.%y " . " %d.%m.%y %a %H:%M "))) > > And indeed in my org files the timestamp are displayed > for example as <19.12.17>. > > However when I use > org-toggle-time-stamp-overlays > they are displayed as <2017-12-19 Tue> > the point is your conversion function will lead to > 2017-12-19 Tue > > > which is much better for my purpose since the < > are deleted. > > > > I am still wondering whether the format I chose via org-time-stamp-custom-formats > could be somehow used, so that the result could be > 19.12.17 You could try (untested): (defun my-format-timestamps (cell) (org-quote-csv-field (replace-regexp-in-string org-ts-regexp-both (lambda (m) (if (not org-display-custom-times) (substring m 1 -1) (let ((hours? (string-match-p "[0-9]+:[0-9]+" m))) (format-time-string (funcall (if hours? #'cdr #'car) org-time-stamp-custom-formats) (org-parse-time-string m))))) cell)))