:!: Improve comparing process for unix/Win text files

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
AntonyD
Power Member
Power Member
Posts: 2120
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

:!: Improve comparing process for unix/Win text files

Post by *AntonyD »

Some people often find themselves working with text files that appear to be identical, but in reality differ only in the way the lines end: Win/UNIX.
And not even on all the lines! Yes, there are indeed such odd cases! Of course, when we edit these files in text editors, we can force them to be identical when comparing. BUT! More often than not, this needs to be done in batch processing – when we are using the folder comparison tool.
And in that tool, such files will always be highlighted as different :cry: .

And if we then run a batch process using a script or text editors—making the line endings uniform—and run the folder comparison again, only then
will identical files be marked as identical. BUT! This means that after the comparison, we will again need to run the batch processing—this time,
perhaps, in the opposite direction—restoring the original line endings.
This is a very long and tedious process, especially if we accidentally make a silly mistake somewhere in the script.

Therefore, I would very much like to see two things:
1) A special viewing mode that HIGHLIGHTS previously invisible line-ending characters in the file comparison tool based on content.
This way, when comparing files, we could immediately see this difference on literally any line. Because, again, there are files where
the main line-end char is in the Windows format, but on just 5 lines UNIX line endings are used.
This is because the files were written in binary format.
Then, if we had enabled this viewing mode in the comparison tool and seen that just 5 lines differ, we would have understood WHAT
we really need to do after the comparison: we would fix the version of the file right there, where only 5 lines have the incorrect line endings.
2) In the folder comparison tool, we would like to have a checkbox to ignore line-ending characters during batch comparison, so that in the final
list of detected differing files, only those files that actually differ in their line content are marked as such. Not just by the line-end characters.
#146217 personal license
User avatar
petermad
Power Member
Power Member
Posts: 17263
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: :!: Improve comparing process for unix/Win text files

Post by *petermad »

It would at least be nice if there was an additional ANSI (CRLF) option in the Encoding button - so it could for example show: ANSI <> ANSI (CRLF).

The comparison should in such an occasion start showing ANSI <> ANSI (CRLF) and if the user changes that to ANSI <> ANSI - then all lines with different line endings should be marked as different, so the user could easily copy those lines to the other side.
License #524 1994
Danish TC Translator
TC 11.57 32+64bit on Windows XP 32bit & Windows 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1413b
TC 3.62 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
JOUBE
Power Member
Power Member
Posts: 1880
Joined: 2004-07-08, 08:58 UTC

Re: :!: Improve comparing process for unix/Win text files

Post by *JOUBE »

As part of changes to how line endings are handled in the file comparison tool, it would first be necessary to explicitly mark the line ending itself (among other reasons, to detect trailing whitespace). I proposed this a long time ago; once implemented, this line-ending marker could simply be visually differentiated across the three possible variants. This would effectively resolve two separate issues within the file comparison tool at once.
Post Reply