|
Post by George on May 16, 2020 15:33:17 GMT -5
SPFLite22.exe (472.5 KB) Hi, Here's a very early Beta version which contains a new command DIFF, which will compare two files and display a report of the changes between the two. Nothing in this version has been cast-in-stone, so feedback is most certainly welcome as to format, visuals etc. The DIFF command works as follows: - The files to be compared should be opened in separate tabs (Edit, View or Browse)
- The format of the DIFF command is:
DIFF tab-num1 tab-num2 [min-match-value] where tab-num1 is the Tab # of the 1st file (Note: the FM tab is 1) tab-num2 is the Tab # of the 2nd file min-match-value is a number indicating how many consecutive matches are required to get the comparison process back in sync. The default is 5 which works well for most source comparisons.
- The output report will be opened in a new CLIP session.
- The color scheme used for the DIFF Inserted and Deleted lines can be customized in Options => Screen
All comments are welcome. Note you should be on V2 already. The download file contains a version named SPFLite22.EXE to keep it separate from the production version. George
|
|
|
Post by mueh on May 17, 2020 11:53:01 GMT -5
George ! I like your DIFF cmd Output where i can X non changed lines with ;x "0" 8 all;f " " 8 all;f --- 1 all but i would like to issue the DIFF cmd in FM . (Open files works already perfect in any Edit Tab with 2 other Tab numbers ) and also in Macro in FM FLIST where it should accept File Names as Argument 1 and 2 supplied by macro . if i set Open Files sort sequence to Name* the Tab nr if FNum +1 (I can Display FNum with full file Name in macro) . For FLIST i can translate the FNum as Input to macro to full Name . I'm already doing that with Compare It? Program but want to do it also with DIFF cmd . Thanks for your Patience
|
|
|
Post by George on May 17, 2020 13:17:08 GMT -5
Thanks for the feedback. This was a quick 'get something that works' effort.
How about: DIFF filename-1 filename-2 for a basic DIFF run
DIFF tabnum1 tabnum2 as right now, minimal typing
DIFF for a pop-up list of open files to choose from
I think I could manage a fudged up two column display with text from both files, but it would NOT be two real windows, just two text columns with as much of the line visible as screen width would allow.
Or I could resurrect the old narrative format as an option. Only Robert has seen this before.
***** BCOMPARE. Version 1.0 ***** Match criteria = 5 lines File-A is: E:\GDrive\Test Data\TestPComp1.txt File-B is: E:\GDrive\Test Data\TestPComp2.txt ========================================= File Mis-Match #1 The following line(s) were deleted from the Old-File > 000003 File Record 3 > 000004 File Record 4 ========================================= File Mis-Match #2 These lines on the Old-File > 000010 File Record 10 > 000011 File Record 11 > 000012 File Record 12 Were replaced by these lines on the New-File > 000008 File Record 10 altered > 000009 File Record 11 altered > 000010 File Record 12 altered ========================================= File Mis-Match #3 The following line(s) were inserted in the New-File between lines 23 and End of file of the Old-File > 000022 An inserted line > 000023 An inserted line =========================================
George
|
|
|
Post by George on May 19, 2020 12:02:34 GMT -5
I plan on releasing a new Beta shortly. It doesn't have the narrative layout, you're right it is 'wordy' and only really useful when there are only a small number of differences.
The Beta will now have a 2nd format option, a 2 column, side-by-side match of the files, as well as an option to suppress the matching lines, leaving only the differences.
Then maybe we can get a few more comments.
George
|
|
|
Post by George on May 20, 2020 11:07:52 GMT -5
SPFLite22.exe (475 KB) OK, here's a 2nd try at the DIFF support, including some of your suggestions. Changes: - Command can now be issued from File Manager
- Two output styles - single column and two column side by side. This is an abbreviated (widthwise) display, the columns do not scroll individually.
- DIFF command with no operands will pop up a dialog to specify the inputs
- DIFF command can specify either Tab #s or file names.
- Files to be compared MUST be open in a tab. (i.e. there is no I/O being done)
- Option to display only the differences, ignoring lines that match.
The syntax of the command is now: DIFF { filename-A | Tab# 1 } { filename-B | Tab# 2 } [ n ] <= minmatch value [ { 1COLUMN | 2COLUMN } ] [ { DIFFONLY | DIFFALL } ] Note: The MinMatch, 1Column/2Column and DIFFONLY/DIFFALL options are retained, you need enter them only if you want to change them. Here's some screen shots:
|
|
|
Post by mueh on May 20, 2020 13:10:18 GMT -5
George: One small Enhacement request for 2COLUMN Display . I want to use DIFFALL so i can x all non changes except f.e METHOD FUNCTION SUB lines so i can see where the Change was done . That's why i love that beautifuly line Editor where i can do all that things . However if a Line is altered as 05054 is i have no way to see that line is changed . Can you add the - sign or any other character if both sides have a line nr and are changed . Here the screen layout Are you interesteste in Macro MI diff 2 3 which opens 2 files from any list and issues DIFF cmd . ELSEIF UCase$(Get_Arg$(1)) = "DIFF" then
if IS_FM then
SPF_EXEC("cmd /C MUE2T.exe "+hWnd+" ""DIFF '"+FMGet_Path$(Get_Arg$(2))+FMGet_Filename$(Get_Arg$(2))+"' '"+FMGet_Path$(Get_Arg$(3))+FMGet_Filename$(Get_Arg$(3))+"' "+Get_Arg$(4)+" "+Get_Arg$(5)+" "+Get_Arg$(6)+"{ENT}") ' execute diff cmd after next line
SPF_Post_Do("V '"+FMGet_Path$(Get_Arg$(2))+FMGet_Filename$(Get_Arg$(2))+"';V '"+FMGet_Path$(Get_Arg$(3))+FMGet_Filename$(Get_Arg$(3))+"'") ' open the 2 files
halt(0,"")
endif
ELSEIF len(ltrim$(Get_Arg$(1),ANY "-_")) <> len(Get_Arg$(1)) and Is_Primary_Cmd then ' SWAP to Tab Name/Nr
Thanks
|
|
|
Post by George on May 21, 2020 11:04:28 GMT -5
mueh The macro, probably not, I'm just not into using your MUE2T tool to stuff commands into SPFLite. I'm impressed that you have it all working so smoothly. As to identifying the changed lines, how about this, it would be simple to add: George
|
|
|
Post by mueh on May 22, 2020 1:01:49 GMT -5
George: i would prefer to use only 1 Byte for the Change flag in the middle and the 2 blanks left and right but it's up to you and others how they like it . You wonder why i use the MUE2T pgm . if can open the 2 files before with VIEW and cmd chain the Diff cmd . However if i compare f.e Backup file with original and i have 2*2 times the full filename and SPF_POST_DO truncated after i guess 256 Bytes . ( same as SPF_EXEC ) Changing to concatemation or excuting in DO file is no Option since VIEW cmd's sometimes are not complete before Diff cmd is executed . I can live with my solution as it works . Thanks _
|
|
|
Post by George on May 22, 2020 8:34:26 GMT -5
OK How about:
|
|
|
Post by mueh on May 22, 2020 11:30:54 GMT -5
George: I like the ~ sign instead of the NOT sign because in Terminal font it's x'AA' and in other x'AC'
|
|
|
Post by George on May 22, 2020 12:30:22 GMT -5
Robert: mueh: OK, I'll switch to the ~, at least it's type-able without having to do an Alt-0172
===> Thanks. Forget about my comment regarding use of = sign instead of | vertical; the vertical is easier on the eyes - R In 2column mode, the width adjusts to whatever the current screen width is. Go full screen with a small font and you'll get a pretty good length. If you want to see the whole line, use 1column. There's nothing that says you couldn't run DIFF once with each and have both versions available at the same time, after all, they're just CLIP sessions and DIFF is almost instantaneous.
OK, I went and browsed screenshots from some other DIFF tools to see how they handle it, I'll remove the strikethrough.
Here's where it's stands now, in fullscreen mode
George
|
|
|
Post by mueh on May 22, 2020 14:27:14 GMT -5
George: With 1COLUMN Display the lines are truncated after screen width . Is there a requirement for this ? Thanks
|
|
|
Post by George on May 22, 2020 15:07:35 GMT -5
Those are not mock-ups, all of this is working functional code. The color scheme for Deleted lines and Inserted lines is entirely up to the user. There are two new items under Options => Screen, so if you don't like the colors, change them.
George
|
|
|
Post by George on May 22, 2020 15:10:51 GMT -5
mueh: They shouldn't be truncated, let me check that.
George
[update] OK, stupid error, corrected. [\Update]
|
|
|
Post by George on May 23, 2020 13:01:05 GMT -5
Reading comments on DIFF, I've made the following changes to improve ease of use. - DIFF can be entered on any tab, including File Manager
- The two file operands can now be:
- A Tab number (FM is 1)
- A filename. The filename NEED NOT be already Open in a tab, it will be opened if needed.
- An * to indicate the current tab (Not allowed in the FM tab, obviously)
- The different operand formats may be mixed.
DIFF 2 3 To DIFF compare tabs 2 and 3
DIFF 2 "E:\MyData\MyData.txt" To DIFF compare tab 2 and "E:\MyData\MyDaya.txt".
DIFF 2 * To DIFF compare Tab 2 and the 'current' tab
DIFF "E:\MyData\MyData 1.txt" "E:\MyData\MyData 2.txt"
To DIFF compare two files, if they are not opened in some tab, they will be opened
I''ll get out a new Beta soon. George
|
|