Comparing TOCs

This forum is for all Flare issues not related to any of the other categories.
Post Reply
ccardimon
Propellus Maximus
Posts: 1571
Joined: Fri Jan 11, 2008 1:30 pm
Location: Horsham, Pennsylvania

Comparing TOCs

Post by ccardimon »

Is there a way to compare one TOC to another that is organized differently, to see what is missing?
Craig

Lost in Disturbia
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Comparing TOCs

Post by LTinker68 »

Within the same project or between projects? It's been awhile since I've done this, but I believe you can still open two files side-by-side by docking one in the left or right pane. If they're in different projects, then you can open two instances of Flare and compare them side by side.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
ccardimon
Propellus Maximus
Posts: 1571
Joined: Fri Jan 11, 2008 1:30 pm
Location: Horsham, Pennsylvania

Re: Comparing TOCs

Post by ccardimon »

Same project. I'm trying to re-organize things better, but my new TOC is off by about 20 items.
Craig

Lost in Disturbia
ecjoe
Propeller Head
Posts: 85
Joined: Fri Aug 02, 2013 10:33 am

Re: Comparing TOCs

Post by ecjoe »

Disclaimer: The following solution is meant for users that are comfortable working outside of Flare to view/modify/compare source code.

If I were faced with this situation, I would perform the following steps:
1. Copy the source code for TOC A and paste it into Notepad++.
2. Reformat the XML so that each tag is placed on a separate line. One way of accomplishing this is by selecting all of the text and then using the Pretty Print (libxml) [experimental] function of the XML Tools plugin.
3. Select all of the text again and then press SHIFT + TAB various times until there are no indented lines.
4. Copy the reformatted text and paste it into Excel.
5. Sort by Column A.
6. Copy the sorted tags and paste it into a code comparison tool. Personally, I use a tool called Code Comparison. It color codes changes to allow you to quickly assess the differences between two files. Additionally, it also allows you to quickly resolve key differences by applying one version of a line to the other file.
7. Repeat steps 1 - 6 for TOC B.

There will be plenty of unimportant differences between the two files. However, you will want to pay special attention to differences for <TocEntry ...> lines.
Joe
(Flare 2017 r2 - Windows 7 64)
Nita Beck
Senior Propellus Maximus
Posts: 3672
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Comparing TOCs

Post by Nita Beck »

No need to work outside of Flare. Lisa's on the right track.

Open the TOCs side by side (by floating one and then docking it to the right or left of the other one). Then, in each, click the View button on the TOC Editor's toolbar to switch to Grid view. Once there, you can SORT the TOCs by the Link column (by any column, actually, but the Link column is probably your best best). You'll then be able to work your way down, comparing row by row, until you hit a topic that is present on one TOC but not on the other.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
Paulie
Sr. Propeller Head
Posts: 140
Joined: Sun Mar 01, 2015 3:01 pm

Re: Comparing TOCs

Post by Paulie »

Edit: Ignore this. I didn't initially see the point about the TOCs being structured differently.

Another option is to use a diff tool, such as Beyond Compare (my preference) or WinMerge (free). Here are the links to the sites:

WinMerge http://winmerge.org/?lang=en
Beyond Compare http://www.scootersoftware.com/
"In an ideal world, software should be simple, well designed, and completely intuitive to end users. In the real world, good documentation is king."
Nita Beck
Senior Propellus Maximus
Posts: 3672
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Comparing TOCs

Post by Nita Beck »

(I know you said to ignore your suggestion, but for benefit of others, I thought some explanation about why BC wouldn't help was in order.)

I use Beyond Compare, too. It's a great little tool. I think every Flare author should have it in his or her tool kit, and I'm glad you mentioned it.

However, I think it would be WAAAY overkill for what Craig is trying to accomplish. He just wants to know which 20 or so topics that he has on the first TOC he's neglected to put on the second TOC, which he says organizes the topics in a completely different way than the first TOC. If he were to use Beyond Compare to compare the code of the two files, he's going to have to shift through potentially hundreds of differences in the *locations* of topics, just to figure out which are the missing 20 or so. But with Flare's Grid view of the TOCs, he can sort them in the same way and then probably fairly quickly find which 20 or so are on TOC 1 but are not on TOC 2.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
ccardimon
Propellus Maximus
Posts: 1571
Joined: Fri Jan 11, 2008 1:30 pm
Location: Horsham, Pennsylvania

Re: Comparing TOCs

Post by ccardimon »

Thanks for the help, people! I appreciate it.
Craig

Lost in Disturbia
ccardimon
Propellus Maximus
Posts: 1571
Joined: Fri Jan 11, 2008 1:30 pm
Location: Horsham, Pennsylvania

Re: Comparing TOCs

Post by ccardimon »

Nita Beck wrote:Open the TOCs side by side (by floating one and then docking it to the right or left of the other one). Then, in each, click the View button on the TOC Editor's toolbar to switch to Grid view. Once there, you can SORT the TOCs by the Link column (by any column, actually, but the Link column is probably your best best). You'll then be able to work your way down, comparing row by row, until you hit a topic that is present on one TOC but not on the other.

Great tip! Thanks, Nita. Using it now.
Craig

Lost in Disturbia
ecjoe
Propeller Head
Posts: 85
Joined: Fri Aug 02, 2013 10:33 am

Re: Comparing TOCs

Post by ecjoe »

@Nita: Nice tip! I completely forgot about Grid view. Also, I noticed that the grid view has an export data to a CSV file. This feature could be used to quickly export sorted topics and then perform a title or link comparison. This would avoid having to manually review hundreds of entries for 20 differences.

FYI, the reason that I suggested using a comparison tool in the first place is that the TOCs are structured differently. If the TOCs were structured in a similar fashion, then it would be a little easier to eyeball the changes. AFAIK, topic locations should not change between two TOCs within the same project.
Joe
(Flare 2017 r2 - Windows 7 64)
Nita Beck
Senior Propellus Maximus
Posts: 3672
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Comparing TOCs

Post by Nita Beck »

ecjoe wrote:Also, I noticed that the grid view has an export data to a CSV file. This feature could be used to quickly export sorted topics and then perform a title or link comparison. This would avoid having to manually review hundreds of entries for 20 differences.
This is what I love about these forums. One person's (Lisa's) idea leads to another person's (my) idea which leads to another person's (your) idea. :)
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
Post Reply