<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Libreoffice on rooiratel</title><link>https://rooiratel.red/tags/libreoffice/</link><description>Stephan Snyman's personal website</description><language>en-gb</language><generator>Hugo</generator><atom:link href="https://rooiratel.red/tags/libreoffice/index.xml" rel="self" type="application/rss+xml"/><item><title>Convert All Word Documents to .odt</title><link>https://rooiratel.red/posts/convert-all-word-docs-to-odt/</link><pubDate>Sun, 20 Sep 2020 09:38:46 +0200</pubDate><guid isPermaLink="true">https://rooiratel.red/posts/convert-all-word-docs-to-odt/</guid><description>This post is not about a quick one-liner script that you can run to convert all Word documents on your PC to .odt files. But if that’s what you are looking for, here you go:
find ./ -type f \( -iname \*.doc -o -iname \*.docx \) -exec libreoffice --headless --convert-to odt {} \;
Just replace the ./ with the directory you want to recursively search in. Also note that this command creates a copy that is converted and does not delete the original document.</description><content:encoded><![CDATA[<p>This post is <strong>not</strong> about a quick one-liner script that you can run to convert all Word documents on your PC to .odt files. But if that&rsquo;s what you are looking for, here you go:</p>
<p><code>find ./ -type f \( -iname \*.doc -o -iname \*.docx \) -exec libreoffice --headless --convert-to odt {} \;</code></p>
<p>Just replace the ./ with the directory you want to recursively search in. Also note that this command creates a copy that is converted and does not delete the original document.</p>
<p>I have dozens of old Word documents on my computer dating back to my childhood days. I finally decided to do a bit of a cleanup and convert them all to .odt so that they are in an open file format that I can trust.</p>
<p>And instead of converting them all in one go using the script above, I decided to do them one by one, and see how well it worked, and to make sure I didn&rsquo;t lose anything.</p>
<p>I started of just seeing how many I had:</p>
<p><code>find ./ -type f \( -iname \*.doc -o -iname \*.docx \) | wc -l</code></p>
<p>Which came to 1996. damn, way more than I thought. Looking through the results (without piping it to wc) I see there are a lot of old school assignments and notes, some programming notes, a lot of music (mainly chord sheets), and finally just some miscellaneous documents.</p>
<p>Most of the documents I no longer needed (like schoolwork) but I converted a lot of them anyway just to see how well it would work. I ended up deleting most of these documents.</p>
<h3 id="what-i-learned">What I learned</h3>
<p>Practically all of the word documents I had were just simple text documents and the occasional image. I had zero problems converting these.</p>
<p>A lot of my school assignments made use of math formulas and tables, and I&rsquo;d say about 99% of them converted without any issue. Not that it mattered because I deleted all my school work afterwards.</p>
<p>What I found interesting after converting a whole bunch of files was that for small files (less than ~20KB) the .odt version was larger than the .docx version. But if the original file was any larger than that, then the file actually got smaller after converting to .odt.</p>
]]></content:encoded></item></channel></rss>