Change bars

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
shiver
Posts: 6
Joined: Wed Nov 05, 2003 11:06 pm

Change bars

Post by shiver »

Hi. First a definition:

"A change bar is a vertical line (usually in the margin) that visually identifies new or revised text." -- FrameMaker 6.0, p391

I want to compare 2 files, and get a single file that identifies changed lines.

I saw that Compare lists differences in a fashion similar to unix diff, but I want change bars.

I am looking for such a facility in TP. I did a search here, but got only 2 hits, neither on point. I looked in the How-To section -- nothing.

Suggestions? ... cheers, drl

Edit 1:

I was able to craft a basic solution with a shell script on unix using tools such as sdiff, grep, cut, sed. I am still interested in other solutions ... cheers, drl

( edit history: # 1 for one solution )
( Minnesota - W2000 / SP4+, dual CPU, 400 MHz, 512 MB; Textpad 4.7.2 / My other computer is an Alpha running Linux )
Ed
Posts: 103
Joined: Tue Mar 04, 2003 9:09 am
Location: Devon, UK

Post by Ed »

Try ExamDiff Pro
http://www.prestosoft.com/ps.asp?page=edp_examdiffpro
It integrates very well with TextPad
shiver
Posts: 6
Joined: Wed Nov 05, 2003 11:06 pm

Post by shiver »

Hi, Ed. Thanks for the pointer. Examdiff looks like a very useful tool for many situations. I looked over the features list and the wish list there, but did not see change-bars. The developer (Gregory) and I exchanged a few emails. Examdiff can highlight with color, but does not provide change-bars ... cheers, drl
( Minnesota - W2000 / SP4+, dual CPU, 400 MHz, 512 MB; Textpad 4.7.2 / My other computer is an Alpha running Linux )
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

I don't know what you understand for "change bar", but ExamDiff (at least in the pro version) has what I would call "change bars".

Have a look at a screen shot:
http://temp.andreas-waechter.de/ed.png (36kb)

I marked what I would call "change bars" in the image...

(at the moment, my ISP has some problems...)
shiver
Posts: 6
Joined: Wed Nov 05, 2003 11:06 pm

Post by shiver »

Hi, MudGuard. Thanks for creatingthe png. I did get a better idea of what ExamDiff will do.

I am interested in getting an ascii result file. Perhaps EDPro will produce that, although my short exposure to EDP suggests that it is aimed more at displaying the results on a monitor.

Let me give you an example of what I mean. I created the output below with a short shell script to list the ascii text files and produce a change-bar listing on a resultant ascii text file. I can then print the resulting ascii text file (to which change-bars have been added) with whatever facility I have (TextPad, for example) to a printer. See below .. cheers, drl

-----

Example of change bar on trival file differences

File 1:

First line
Last line

File 2:

First line amended
Last line

Differences marked with change bar:

| First line amended
Last line
( Minnesota - W2000 / SP4+, dual CPU, 400 MHz, 512 MB; Textpad 4.7.2 / My other computer is an Alpha running Linux )
User avatar
talleyrand
Posts: 625
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post by talleyrand »

So, would you want it to do multiple files or just two?

Assuming just two files, you'd run your MagicTool against file1 and file2. I'm a touched confused about the results though. In the example provided, it looks like the results would be eveything in file 2 with that line prepended with a pipe (or some other indicator) to indicate it is different from file 1. However, in your initial post, it sounds like you only want to see changed lines.

So would you want it to be

Code: Select all

Differences marked with change bar: 

| First line amended 
Last line
or

Code: Select all

Differences marked with change bar: 

| First line amended 
Also, you're looking to have this integrated into TP, yes? Otherwise the change bar will alter the results of your text

I believe one of the comparison tools has enough brains to figure out when the files match up again and not just a line by line comparison. e.g.
f1
Bob
writes
good
regular
expressions
f2
Bob
Hansen
writes
good
and
clever
regular
expressions

c:\>fc f1.txt f2.txt
Comparing files f1.txt and F2.TXT
***** f1.txt
Bob
writes
***** F2.TXT
Bob
Hansen
writes
*****

***** f1.txt
good
regular
***** F2.TXT
good
and
clever
regular
*****

***** f1.txt

***** F2.TXT
*****

Would that be what you want? The tool can tell that there's a new or missing line but it eventually sync's up for further comparison or should it do a pure line-by-line comparison?

If you just wanted what has changed, I suspect it'd be rather simple to capture the output of this and parse out everthing between the opening and closing
***** FILE2.TXT
*****
I choose to fight with a sack of angry cats.
shiver
Posts: 6
Joined: Wed Nov 05, 2003 11:06 pm

Post by shiver »

Hi, talleyrand. Thanks for your post.

I want to compare just 2 files right now.

You mentioned "regular expressions", so I'll assume you know something about unix. One of the core ideas behind most of the commands in unix is that you read stuff in and you spit it out, possibly transformed in some fashion.

So, yes, I want the result file itself to show the pipe symbol.

In the case you wrote with f1 and f2, I would like the output to be essentially all the lines in f2, no marking if the files are the same for that line, but marked if they differ. So specifically, for f1 and f2, you would get (and this directly from my shell script):

Code: Select all

  Bob 
| Hansen 
  writes 
  good 
| and 
| clever 
  regular 
  expressions 
I may have led folks astray by mentioning FrameMaker. If you hadn't used it, or seen older technical documents that often contained change-bars, you may have missed my point, and for that I apologize ... cheers, drl
( Minnesota - W2000 / SP4+, dual CPU, 400 MHz, 512 MB; Textpad 4.7.2 / My other computer is an Alpha running Linux )
Post Reply