Paste section with recorded changes showing

Discuss the word processor

Paste section with recorded changes showing

Postby catbill » Fri Nov 17, 2017 7:24 pm

When using record changes, how can we paste text within or between documents while still showing the suggested edits? For example, I have split a document into files A and B because record changes slows with larger documents. Now I want to recombine them but cannot find how to do so. None of the posts I have found about this give clear, useful answers.

I have asked about this in LibreOffice a few times and never received an answer. Perhaps it is not possible. It would be extremely helpful to know either way.
LibreOffice 6.2.6.2
catbill
 
Posts: 75
Joined: Sun Oct 08, 2017 6:51 pm

Re: paste section with recorded changes showing

Postby acknak » Fri Nov 17, 2017 8:50 pm

Greetings and welcome to the community forum!

I would try something like this:

Open file A
Move to the end (Ctrl+End) and make sure the cursor is on an empty paragraph.
Insert file B (Insert > File ...)

As far as I know, all the change records will be preserved in the combined document.

I've never worked with a document having lots of changes, but I have seen some that were rather messy. Does it not make sense to make decisions about the changes and move to a new version of the document that would incorporate the changes without retaining the full history?
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: paste section with recorded changes showing

Postby catbill » Fri Nov 17, 2017 9:20 pm

Hi acknak,

Unfortunately, inserting the text as a file shows all of the inserted text as new text, without individual edits.

If I were editing for myself, yes, it would make sense to just make decisions before moving the text (but then why would I be using record changes?). However, I work as an editor and clients need to see the changes I am suggesting.

If there are not many edits, I can use Compare Documents to show the edits without needing to record the changes earlier. Unfortunately, when there are many changes in a paragraph, Compare Documents just shows inserted and deleted versions of the paragraph, not individual edits.

Anyway, thank you for the suggestion.
LibreOffice 6.2.6.2
catbill
 
Posts: 75
Joined: Sun Oct 08, 2017 6:51 pm

Re: paste section with recorded changes showing

Postby RoryOF » Fri Nov 17, 2017 9:23 pm

Is the file being inserted an .odt?
Apache OpenOffice 4.1.6 on Xubuntu 18.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 29438
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: paste section with recorded changes showing

Postby catbill » Fri Nov 17, 2017 9:30 pm

Yes.
LibreOffice 6.2.6.2
catbill
 
Posts: 75
Joined: Sun Oct 08, 2017 6:51 pm

Re: paste section with recorded changes showing

Postby RoryOF » Fri Nov 17, 2017 9:32 pm

Perhaps inserting the file as an element of a Master Document might preserve the changes.
Apache OpenOffice 4.1.6 on Xubuntu 18.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 29438
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: paste section with recorded changes showing

Postby Bill » Fri Nov 17, 2017 10:18 pm

As far as I know, you can only preserve the recorded changes by merging changed copies back into an unchanged original. I doubt that this can be done by pasting since pasting content is just as much a change as typing and deleting content. Search the Help Index for "merging;documents".
AOO 4.1.6 and LO 6.2.0.3 on Manjaro MATE
Bill
Volunteer
 
Posts: 7319
Joined: Sat Nov 24, 2007 6:48 am

Re: paste section with recorded changes showing

Postby catbill » Fri Nov 17, 2017 10:38 pm

RoryOF wrote:Perhaps inserting the file as an element of a Master Document might preserve the changes.

Just tried that but it accepted all of the edits. Seemed like a good idea.
LibreOffice 6.2.6.2
catbill
 
Posts: 75
Joined: Sun Oct 08, 2017 6:51 pm

Re: paste section with recorded changes showing

Postby catbill » Fri Nov 17, 2017 10:59 pm

Bill wrote:As far as I know, you can only preserve the recorded changes by merging changed copies back into an unchanged original. I doubt that this can be done by pasting since pasting content is just as much a change as typing and deleting content. Search the Help Index for "merging;documents".


Bill, That works well for showing edits to the same text. As I may have said earlier, the reason I still use record changes is that when there are many changes to a paragraph, merge/compare documents shows the entire original paragraph as deleted and the entire edited text as an insertion. It does not show the individual edits.

However, I am trying to combine different texts.

Perhaps that are no solutions with .odt. Other people have been asking about this and I know that it can be done in Word. Also, it would be useful to have the ability to move sections in the same document and still show the edits.

If no one can think of a solution, I will request this for future versions.
LibreOffice 6.2.6.2
catbill
 
Posts: 75
Joined: Sun Oct 08, 2017 6:51 pm

Re: paste section with recorded changes showing

Postby acknak » Fri Nov 17, 2017 11:09 pm

I was able to do it with a bit of effort using a text editor on the document xml. It's not terribly difficult but it's not trivial either.

If you want to try it, I can describe the steps I followed. You would need to be familiar with extracting a file from a zip archive, editing the xml text and updating the archive with the edited file.
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: paste section with recorded changes showing

Postby catbill » Sat Nov 18, 2017 1:20 am

Acknak
,
That is wonderful to hear. Thank you so much for making the effort to figure this out.

I have not worked with xml text but am happy to learn and eager to find out how to do this.

Cathy
LibreOffice 6.2.6.2
catbill
 
Posts: 75
Joined: Sun Oct 08, 2017 6:51 pm

Re: paste section with recorded changes showing

Postby acknak » Sat Nov 18, 2017 8:15 am

 Edit: PS: 
As I write this, it seems a lot more complex. It's not hard but if it's all new, it may be a lot to bite off.

Ok, so the basic structure of xml markup is similar to html: there are tags that mark the start and end of some arbitrary content. The content may be plain document text, or it may be more tags, or it may be a combination of text and tags. Tags are always balanced and nested; that is, every start tag must have a matching end, and tags that enclose other tags must not overlap.

Document content in a .odt is found in the content.xml file within the document archive. You can extract the content.xml file by opening the .odt file with a zip archive tool; the extracted content.xml is a plain text file. I suggest that you open the document(s) you want to merge in OO Writer, then set the option Tools > Options > Load/Save > General > Size optimization: OFF, then save a copy of the document.

I'm assuming you have a main document, M, and you want to merge in a separate sub-document which I'll call S. The basic idea is to copy two distinct portions of the xml content from S into M. To make the changes recorded in S unique in the merged document, we use Find/Replace to add a letter to the change IDs before copying.

Step 1) Extract the content.xml from S.odb
2) Open the content.xml file in an editor (for example, Notepad)
3) Find & replace "ct- with "ct-s
4) Select everything from the start tag <text:tracked-changes ...> to the end tag </text:tracked-changes>
Call this stuff TC. It contains all the information the changes.
5) Copy TC to the clipboard
6) Back to main content.xml
5) Find the tag <office:text ...> and insert all of TC just after it.

6) Now select & copy the document content from S: all from the first paragraph, <text:p> through the end of the last paragraph: </text:p>
Call this DC
7) Insert DC in main content.xml, just after the end tag of the last paragraph: </text:p>
8) Save the modified/merged main content.xml and update the content.xml in the main.odt zip archive
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: paste section with recorded changes showing

Postby catbill » Sun Nov 19, 2017 6:09 am

Acknak,

Thank you again for taking the time to write out such detailed explanations and instructions.

A few questions:

When I tried to replace ct- with ct-s, ct- could not be found. Any thoughts about what I might have done wrong?

In step 8, do I just copy and paste to update content.xml in the main.odt zip archive?

If S is ready after step 8, how should it be combined with M?

With great appreciation for your help.

Cathy
LibreOffice 6.2.6.2
catbill
 
Posts: 75
Joined: Sun Oct 08, 2017 6:51 pm

Re: paste section with recorded changes showing

Postby acknak » Sun Nov 19, 2017 4:08 pm

catbill wrote:... When I tried to replace ct- with ct-s, ct- could not be found.

Hmm. When I look at content.xml from a document with changes, I see markup like this:

<office:body>
<office:text ...>
<text:tracked-changes text:track-changes="false">
<text:changed-region xml:id="ct-1474847884" text:id="ct-1474847884">
<text:insertion>
<office:change-info>
<dc:creator>Joe Smith</dc:creator>
<dc:date>2017-11-04T17:01:00</dc:date>
</office:change-info>
</text:insertion>
</text:changed-region>
...

The IDs (bold above) are used to uniquely identify each change. The ID can (apparently) be anything, as long as it's unique in the file.

The intent here is to change all the IDs by adding a distinguishing letter: ct-1474847884 → ct-s1474847884, so that when the files are merged, if there happens to be a change already labeled ct-1474847884, the incoming ID won't conflict with it.

If you don't see IDs of this form, it could be that your version of OO uses some other characters in the IDs, or there are no changes in the file, or, could you be looking at a sub-file other than content.xml?

In step 8, do I just copy and paste to update content.xml in the main.odt zip archive?

If S is ready after step 8, how should it be combined with M?

This process changes the text file(s) content.xml. For editing the text, you can just copy/paste and save the changed file as usual. For updating the archive, you have to use a zip archive tool of some kind to take the changed content.xml and update that sub-file in the archive.

Trying to describe this, I can see that it would be a lot to digest. If you can send the files, I'd be willing to take a look. It would take less time to do it than to describe it ;-)
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: paste section with recorded changes showing

Postby catbill » Sun Nov 19, 2017 10:00 pm

Thank you for hanging in there with me and for the additional information.

The IDs in the file I am working with are preceded by just "ct without a dash. I was able to replace "ct with "ct-s (and hope that there is no other code that also contains "ct).

I have selected the text as suggested in step 4 and have a couple of questions.

1. What is the easiest way to select the code from tag to tag? I wrote down the line and column but it was still laborious to copy. It looks like "Go to" only asks for the line. Coders must have an easier way to do this. How do you do it?

2. Step 5 says to copy the code to the clipboard. Is it necessary to paste it to a clipboard when the next action is to paste the text in another part of the same document? I tried to do that but found that <office:text> appears toward the beginning and toward the end. After which one should the copied code be inserted?

(Meanwhile, I got sidetracked trying to find a clipboard. I have tried Ditto and Ctrl+C but have had problems with both. Before I waste more time on this, do you have any recommendations for a clipboard?)

In any event, I would be happy to send you the relevant documents so you can see what I am working with. Actually, I think I will send you shorter versions so they will be easier to work with. I have already submitted the final product and the goal now is to learn how to do this in the future (and to show other people as well). What is the best way to send you the files?
LibreOffice 6.2.6.2
catbill
 
Posts: 75
Joined: Sun Oct 08, 2017 6:51 pm

Re: paste section with recorded changes showing

Postby robleyd » Mon Nov 20, 2017 1:39 am

Step 5 says to copy the code to the clipboard


Just copy it - using the keyboard Ctrl-C, or with the mouse; Windows will automatically put it in the Windows clipboard for you to use later when you paste.
Cheers
David
Apache OpenOffice Developer Build 4.2.0 9820 - Slackware 14.2 - 64 bit
LibreOffice 6.0.7.3 - Slackware 14.2 - 64 bit
Apache OpenOffice 4.1.4 - Windows 7 Virtual machine
User avatar
robleyd
Moderator
 
Posts: 2933
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: paste section with recorded changes showing

Postby acknak » Mon Nov 20, 2017 5:43 am

catbill wrote:... the goal now is to learn how to do this in the future (and to show other people as well). What is the best way to send you the files?

You can click the email button to the right of any of my posts, and I will respond with an address that will accept attachments.

As to the future, I'd vote for avoiding the situation by running accept/reject changes more often so the number of changes doesn't get too big and cause the slowdown.

It may be possible to write some macro code to manage this; I can't make any suggestions along that line.
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Paste section with recorded changes showing

Postby catbill » Mon Nov 27, 2017 9:00 pm

Hi acknak,

I didn't finish this and am going to start over with a small extract. A smaller file should make it easier to navigate around the xml file. I have another question:
In step 5, you said to insert TC just after <office:text> but should it be after the tag that appears toward the beginning or the tag toward the end?

Yes, it would certainly be better to accept/reject changes before merging. That is not always possible, however. In my case, the clients need to make those decisions.

I would be happy to send you files if needed. However, this is not a deliverable for someone else. My only goal is to learn how to do this.

Thank again.
LibreOffice 6.2.6.2
catbill
 
Posts: 75
Joined: Sun Oct 08, 2017 6:51 pm

Re: Paste section with recorded changes showing

Postby acknak » Tue Nov 28, 2017 3:05 am

In step 5, you said to insert TC just after <office:text> but should it be after the tag that appears toward the beginning or the tag toward the end?

The one at the beginning. The text-change records appear toward the beginning of the document content, before the actual document paragraphs.
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Paste section with recorded changes showing

Postby catbill » Tue Nov 28, 2017 6:40 am

Thank you. Here is an update: I got to step 8 but am not sure what is meant by “update the content.xml in the main.odt zip archive.” Using your labels, there is a Main .odt file and a Main folder that contains the files extracted from the Main file. I have made the changes to the content.xml file in the Main folder but don’t know how to make those changes apply to the .odt file.

Also, in step 6, I could find only <text:p with other text following. That is, there is no > following the p. I could find </text:p>

Thanks again.
LibreOffice 6.2.6.2
catbill
 
Posts: 75
Joined: Sun Oct 08, 2017 6:51 pm

Re: Paste section with recorded changes showing

Postby RoryOF » Tue Nov 28, 2017 8:05 am

You unzipped the .odt files to get content.xml; replace content.xml with the edited version and rezip the same group of files, renaming the .zip to .odt
Apache OpenOffice 4.1.6 on Xubuntu 18.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 29438
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Paste section with recorded changes showing

Postby acknak » Tue Nov 28, 2017 4:07 pm

catbill wrote:... I have made the changes to the content.xml file in the Main folder but don’t know how to make those changes apply to the .odt file.

My approach is to have the zip archive tool "update" the content.xml inside the .odt document archive with the modified content.xml. That "update" function may not be available in all zip tools, or you may have to poke around to find it. It might work to drag the modified file and drop it on the archive; that may trigger the update function.

I've not had consistent success with simply building a new archive from the unpacked files: the ODF standard places some requirements on the order of the items in the zipped archive, and that doesn't always happen when you build a new zip from the files.

Also, in step 6, I could find only <text:p with other text following. That is, there is no > following the p. I could find </text:p>


Yes, that's right. I just didn't quote the stuff following.
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Paste section with recorded changes showing

Postby catbill » Tue Nov 28, 2017 6:35 pm

Unfortunately, I still need guidance. I probably should have been more specific. I also should have said that I have unzipped files many times but know little else about zipping.

I still don’t know what is meant by “update the content.xml in the main.odt zip archive.” Since I have already saved the content.xml file, “update” must mean something other than save. I have been assuming that it means to somehow process the files in the Main folder so that they can become a single file that is a revised version of the original Main file. Is that correct?

You also suggest that I “drag the modified file and drop it on the archive.” I don’t understand this. The content.xml file is already inside the folder containing the unzipped Main files. Why would it be outside the folder?

It sounds like RoryOF is saying to just rezip the zip archive folder and rename it as an .odt file. I tried doing that using the zip option in Windows Explorer. But Windows warns that renaming the file as .odt could make the files unstable.

I have used 7-Zip but haven't been able to find a command that sounds like it could zip the files in the folder to make a revised .odt file. Perhaps the name of the option is not obvious to me. Given its reputation, it seems like 7-Zip should be able to do this. However, if you don't know what the option is called in 7-Zip, would you mind suggesting a tool that you know is able to do this?

It sounds like what I need to do should not be difficult. I must be missing some basic understanding of what is needed or somehow misunderstood the steps.

I appreciate the time you are taking to explain all of this.
LibreOffice 6.2.6.2
catbill
 
Posts: 75
Joined: Sun Oct 08, 2017 6:51 pm


Return to Writer

Who is online

Users browsing this forum: No registered users and 34 guests