diff on map files with line numbers

Brian K. White brian at aljex.com
Mon Sep 19 12:16:56 PDT 2011


On 9/19/2011 11:49 AM, Tony Freehauf wrote:
> anyone have a script to use diff to compare two filepro map files&  show
> the lines that are different with filepro lines numbers?
> thanks
> old tony

http://www.aljex.com/bkw/filepro/mapdiff

mapdiff file1 file2

It specifically parses map files which helps you spot what really 
matters a little. It displays the filepro field numbers (not the text 
file line numbers which are off-by-one), displays both files side by 
side, and highlights specifically the part of the line that changed, so 
you can easily pay attention to, or easily disregard, the parts you're 
interested in. IE, if you're looking for a byte-count difference, then 
you don't care about the name or even the edits right then, and too many 
name differences will make it hard to find the one field length 
difference you're really trying to find, or trying to make sure doesn't 
exist.

Output is side by side

Field#|NameA:LenA:EditA:|NameB:LenB:EditB:

ONLY shows lines that differ.
If two files are identical, there is no output.

The parts that differ are highlighted with reverse video.
The reverse video is hard coded using generic vt/ansi escape codes that 
happen to be the same for sco-ansi and linux and xterm.

For visual clutter reduction, it treats "*" the same as "" in an edit 
field, and always displays "". That's just for display purposes and code 
simplicity. Don't get confused if your file has *'s in it but they don't 
appear in the output.

If one file has fewer lines than the other, the missing lines are 
displayed as -:-:- and a line count summary is printed at the end so you 
won't accidentally miss that one or more lines were -:-:-

Other than that it doesn't do anything too fancy.

-- 
bkw


More information about the Filepro-list mailing list