You are not logged in.

#1 2019-05-24 20:47:08

makh
Member
Registered: 2011-10-10
Posts: 299

Libreoffice - Convert text to odt with Format

Hi

I have already made a file in odt format, with header and footer.

I have many text files and want to convert to odt file, with every file having the above format using:

soffice --headless --convert-to odt file.txt

Can I accomplish this task in bash? It will save a lot of manual copy paste!

Thanks in advance!


OS:  Arch  &/  Debian
System: LENOVO ThinkPad E14
Desktop: Xfce

Offline

#2 2019-05-24 21:19:50

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: Libreoffice - Convert text to odt with Format

You'll probably need unoconv (in extra) in addition to libreoffice and you have to save your template document as a real template (ott)


unoconv -f odt -t template.ott -o result.odt file.txt

| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#3 2019-06-03 18:50:23

makh
Member
Registered: 2011-10-10
Posts: 299

Re: Libreoffice - Convert text to odt with Format

Hi

It works. Thanks a lot.

But it only copies the header and footer.

If I want to copy a designed table with contents, it doesnt.

Thankyou


OS:  Arch  &/  Debian
System: LENOVO ThinkPad E14
Desktop: Xfce

Offline

#4 2019-06-03 19:29:48

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: Libreoffice - Convert text to odt with Format

You have tables in your text files? Then maybe use something like pandoc or markdown to convert it to an intermediate format first like html. pandoc might be able to directly create an odt file, but I don't know how that would work with templates.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#5 2019-06-05 07:53:22

makh
Member
Registered: 2011-10-10
Posts: 299

Re: Libreoffice - Convert text to odt with Format

Hi

No. I have tables in my reference format odt file!

Thankyou


OS:  Arch  &/  Debian
System: LENOVO ThinkPad E14
Desktop: Xfce

Offline

Board footer

Powered by FluxBB