From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ruijie Yu via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help Subject: Re: get text from LibreOffice Calc to Emacs Org-Mode Date: Mon, 24 Apr 2023 14:53:47 +0800 Message-ID: References: <4f6cadb4-9283-e2de-d610-d96d0706defe@posteo.de> <601ad8b1-9cd4-2bbb-166a-225cb3fde74d@posteo.de> <81b6e7ca-62e5-4ae2-ae7d-81a7604002a6@gmail.com> <96b369f0-8f7e-300b-07d9-542de6b537f3@posteo.de> <30c883fc-7848-a9b0-ec3b-284690a7a179@gmail.com> Reply-To: Ruijie Yu Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36735"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.22; emacs 30.0.50 Cc: Gottfried , help-gnu-emacs@gnu.org To: Platon Pronko Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 24 08:56:44 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pqq7w-0009N2-EJ for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 24 Apr 2023 08:56:44 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pqq7J-0000Ja-Dh; Mon, 24 Apr 2023 02:56:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pqq76-00008t-Rp for help-gnu-emacs@gnu.org; Mon, 24 Apr 2023 02:55:54 -0400 Original-Received: from netyu.xyz ([152.44.41.246] helo=mail.netyu.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pqq75-0003ZW-7a for help-gnu-emacs@gnu.org; Mon, 24 Apr 2023 02:55:52 -0400 Original-Received: from fw.net.yu.netyu.xyz ( [222.248.4.98]) by netyu.xyz (OpenSMTPD) with ESMTPSA id 8130e0cf (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 24 Apr 2023 06:55:42 +0000 (UTC) In-reply-to: <30c883fc-7848-a9b0-ec3b-284690a7a179@gmail.com> Received-SPF: pass client-ip=152.44.41.246; envelope-from=ruijie@netyu.xyz; helo=mail.netyu.xyz X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:143361 Archived-At: Platon Pronko writes: > On 2023-04-23 21:22, Gottfried wrote: >> Hi, >> yes, wonderful, you understood me. >> Sorry, for not explaining it more correctly. >> Because I have much text in each cell, >> colums a and column b, >> each with much text, >> and underneath the same, >> and so on... >> I can=E2=80=99t create such a nice diagramm like this in emacs yet, >> so I couldn=E2=80=99 explain it graphically. >> =C2=A0 |---------+---------| >> > | column1 | column2 | >> > | alpha=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1 | >> > | beta=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2 | >> > | gamma=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 3 | >> > |---------+---------| >> =C2=A0 | column1 | column2 | >> > | alpha=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1 | >> > | beta=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2 | >> > | gamma=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 3 | >> > |---------+---------| >> =C2=A0 | column1 | column2 | >> > | alpha=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1 | >> > | beta=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2 | >> > | gamma=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 3 | >> > |---------+---------| >>=20 > > Is there multiline text, as well? > > I'm afraid there's nothing built in that can handle your requirements. > > You can always achieve that with a bit of coding, however. I'm not sure h= ow comfortable it would be for you, though - it might get quite convoluted,= and at that point I somewhat doubt if it makes sense to use Emacs for such= tabular data at all (I usually think that it's best to choose the right to= ol for the job). > > That said, if you still want to copy the data from Calc into Emacs and fo= rmat it according to your needs, you have two options: > > 1. Use some external script to transfer clipboard contents from Calc form= at into Org-table format. So you C-c in Calc to copy the table, invoke exte= rnal script to transform the clipboard, then paste the contents into Emacs.= Personally I'd prefer Python, but you can use whatever you are comfortable= with; > > 2. Get clipboard contents and perform transformation directly in Emacs. S= o you C-c in Calc, then call M-x paste-from-libreoffice-calc in Emacs. The = code will be something like this: > > (defun paste-from-libreoffice-calc () > (interactive) > (let* ((selection (gui-get-selection 'CLIPBOARD (intern "application/x-= libreoffice-tsvc"))) Why not just use quote? :) ---- Alternatively, you may find `org-table-import' useful. I believe Calc can export to simple formats like CSV or TSV, and you may be able to use this function to convert into a table. --=20 Best, RY [Please note that this mail might go to spam due to some misconfiguration in my mail server -- still investigating.]