3

I worked for a long time on a Pages document: file.1.pages.

I didn't activate Edit > Track Changes.

I saved the modified Pages with a new name: file.2.pages.

Now I would like to check I didn't forget a key point or made any error and review all the modifications I made.

How may I compare file.1.pages and file.2.pages?

This isn't a comparison I can deal with manually (too much text, too many small spelling fixes).

I can't use any Microsoft software. I can use any Unix command line.

  • 1
    If you are only looking at the text (i.e., don't need to compare formatting changes as well), you could export both .pages files to plain text (File -> Export...) and then compare them with diff/Xcode's FileMerge/etc. – Merlin Feb 22 '17 at 5:56
2

Here is how to proceed. The receipe isn't as simple as I thought.

  1. From Pages export files to plain text:

    File > Export > Plain Text...

    so as to get 2 files: file.1.txt, file.2.txt.

  2. Open both files with vi and apply the following command:

    :%s,+V+M,+V+M,g

    this command contains twice the sequence control+V, control+M which is the way to enter the raw return character. The strange effect of this command is to replace any return character (0x0d) with a standard newline character (0x0a) everywhere (g = global). Then the 2 files are now splitted in different lines and it becomes useful to compare them with any Unix text tool.

  3. Change the 2 files encoding:

    :set fileencoding=utf-8

    so as to encode them as text files (and not binary files as they were exported from Pages).

  4. Save the two files and quit vi:

    :wq

  5. Run the standard diff command to compare the 2 text files:

    diff file.1.txt file.2.txt

  • Not ideal as you lose all kinds of formatting and footnotes when you turn it into plain text. – weltschmerz Oct 29 at 8:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .