help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: get text from LibreOffice Calc to Emacs Org-Mode


From: Ruijie Yu
Subject: Re: get text from LibreOffice Calc to Emacs Org-Mode
Date: Mon, 24 Apr 2023 14:53:47 +0800
User-agent: mu4e 1.9.22; emacs 30.0.50

Platon Pronko <platon7pronko@gmail.com> 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’t create such a nice diagramm like this in emacs yet,
>> so I couldn’ explain it graphically.
>>    |---------+---------|
>>  > | column1 | column2 |
>>  > | alpha   |       1 |
>>  > | beta    |       2 |
>>  > | gamma   |       3 |
>>  > |---------+---------|
>>    | column1 | column2 |
>>  > | alpha   |       1 |
>>  > | beta    |       2 |
>>  > | gamma   |       3 |
>>  > |---------+---------|
>>    | column1 | column2 |
>>  > | alpha   |       1 |
>>  > | beta    |       2 |
>>  > | gamma   |       3 |
>>  > |---------+---------|
>> 
>
> 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 how 
> 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 tool 
> for the job).
>
> That said, if you still want to copy the data from Calc into Emacs and format 
> it according to your needs, you have two options:
>
> 1. Use some external script to transfer clipboard contents from Calc format 
> into Org-table format. So you C-c in Calc to copy the table, invoke external 
> 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. So 
> 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.

-- 
Best,


RY

[Please note that this mail might go to spam due to some
misconfiguration in my mail server -- still investigating.]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]