libreoffice-writer

an option or extension to export changes made to the document


I have enabled track changes and changed 2 words as seen in this screenshot.

atest > test trac > track

Can I save this list of 2 lines in a csv or .txt file? I do not see "export changes" option anywhere.

enter image description here


Solution

  • From the menu (option or extension): no, not that I know of. But with a tool? In theory that would be perfectly possible.

    You can open the ODT file as a ZIP file. This allows access to the content.xml sub-file, where changes are stored in the <text:tracked-changes> XML node.

    In each "changed-region" you will find whether it is an insert, a deletion, and who and when did it, together with an ID that maps to a <text:change-end text:change-id="ctUNIXTIME_IN_SECONDS"/> node inside the text itself (not so useful for tracking).

    If you apply the changes in timestamp order, that's the "accept all changes" algorithm.

    I believe you could actually get a CSV object from the XML file with the appropriate XSLT directives.

                <text:p text:style-name="P2">
                    <text:span text:style-name="T1">Seconda</text:span>
                </text:p>
            </text:deletion>
        </text:changed-region>
        <text:changed-region xml:id="ct1526650030752" text:id="ct1526650030752">
            <text:insertion>
                <office:change-info>
                    <dc:creator>Leonardo Serni</dc:creator>
                    <dc:date>2021-01-18T00:44:08</dc:date>
                </office:change-info>
            </text:insertion>
        </text:changed-region>
        <text:changed-region xml:id="ct1526650030272" text:id="ct1526650030272">
             <text:insertion>
                  <office:change-info>
                      <dc:creator>Raffaello Mascetti</dc:creator>
                      <dc:date>2021-01-18T00:44:02</dc:date>
                  </office:change-info>
             </text:insertion>
        </text:changed-region>
    </text:tracked-changes>
    
    <text:p text:style-name="P2">
        <text:change text:change-id="ct1526650030512"/>
        <text:change-start text:change-id="ct1526650030752"/>
        <text:span text:style-name="T3">Terza</text:span>
        <text:change-end text:change-id="ct1526650030752"/>
        <text:span text:style-name="T2"> modifica.</text:span>
        <text:change-start text:change-id="ct1526650030272"/>
    </text:p>
    <text:p text:style-name="P3">Ancora.
        <text:change-end text:change-id="ct1526650030272"/>
    </text:p>