Ignore newlines in Synchronize Dirs
Moderators: Hacker, petermad, Stefan2, white
- lbrozovsky
- Junior Member
- Posts: 2
- Joined: 2008-08-21, 09:57 UTC
- Contact:
Ignore newlines in Synchronize Dirs
Make it possible (by checkbox) to ignore different styles of newlines in Commands/Synchronize Dirs...
Re: Ignore newlines in Synchronize Dirs
Hello, lbrozovsky.
Care to explain perhaps? I do not understand.
Karl
Hm, and why should this be necessary? How could a "Synchronize Dirs" hold different styles of newlines?lbrozovsky wrote:Make it possible (by checkbox) to ignore different styles of newlines in Commands/Synchronize Dirs...

Care to explain perhaps? I do not understand.
Karl
- lbrozovsky
- Junior Member
- Posts: 2
- Joined: 2008-08-21, 09:57 UTC
- Contact:
Re: Ignore newlines in Synchronize Dirs
Hi, well there are situations where a directory tree travels through several different systems (e.g. CVS + multiple OS) and during that process newline styles might get altered (crlf <-> lf). Nevertheless I would like to use the "Synchronize Dirs" command with a "Ignore newline styles" checkbox enabled to see the list of real file modifications.
In the current version I get the list of for example 1000 "modified" files from which 980 are found as modified just because newline styles are altered there. But what I need is the list of those 20 files which are really internally modified.
In the current version I get the list of for example 1000 "modified" files from which 980 are found as modified just because newline styles are altered there. But what I need is the list of those 20 files which are really internally modified.
Hello, lbrozovsky.
Now I see. Thanks for elaborating the problem.
The difference really is CR vs LF vs CRLF (Mac / Unix / Windows textfiles) inside pure text files only. The filesizes will differ by 1 byte / line because e.g. LF is just 1 byte whereas CRLF are 2 bytes. Therefore TotalCommander will identify those text files as different.
Telling from a quick synchronize test over FTP (Synchronize folders: Windows <=> Unix), the "Compare by content" option is unavailable. But doing a compare by content would be the only way for T.C. to find out which text files only differ in LF vs CRLF.
I do not know whether there is a good solution to this issue using T.C. alone. Personally I hardly ever encounter this issue, because on the Windows machine I save text files which will be used on Unix machines in the Unix text format. (Transfer mode: binary)
Maybe someone else knows how to make the Synchronize Folders function do what you need.
Kind regards,
Karl
Now I see. Thanks for elaborating the problem.

The difference really is CR vs LF vs CRLF (Mac / Unix / Windows textfiles) inside pure text files only. The filesizes will differ by 1 byte / line because e.g. LF is just 1 byte whereas CRLF are 2 bytes. Therefore TotalCommander will identify those text files as different.
Telling from a quick synchronize test over FTP (Synchronize folders: Windows <=> Unix), the "Compare by content" option is unavailable. But doing a compare by content would be the only way for T.C. to find out which text files only differ in LF vs CRLF.
I do not know whether there is a good solution to this issue using T.C. alone. Personally I hardly ever encounter this issue, because on the Windows machine I save text files which will be used on Unix machines in the Unix text format. (Transfer mode: binary)
Maybe someone else knows how to make the Synchronize Folders function do what you need.
Kind regards,
Karl
WinMerge can ignore line breaks, check Edit => Options => Compare => Ignore carriage return differences...
Set left and right directory, then execute that:
Icfu
Set left and right directory, then execute that:
Code: Select all
Command: %ProgramFiles%\WinMerge\WinMergeU.exe
Parameter: /x /s /r /e %p%n %t%m
This account is for sale
-
- Junior Member
- Posts: 3
- Joined: 2010-11-19, 05:46 UTC
Re: Ignore newlines in Synchronize Dirs
I'd love this functionality - as there's already a compare by content, it should not be extremely hard to implement it, as file content comparison already displays "0 differences" in such cases.lbrozovsky wrote:Make it possible (by checkbox) to ignore different styles of newlines in Commands/Synchronize Dirs...
My setup: I'm using SVN on windows, but sometimes I get modified sources on a linux samba drive - there it comes handy.
Re: Ignore newlines in Synchronize Dirs
Not very often but i've faced this issue too. Indeed it would be useful and it does not seem that difficult to implement when comparing files as "text".lbrozovsky wrote:Make it possible (by checkbox) to ignore different styles of newlines in Commands/Synchronize Dirs...
- Wanderer -
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
- ghisler(Author)
- Site Admin
- Posts: 50486
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
This is already supported, just use the compare plugin by clicking on the >> button behind the "By content" checkbox. Then you can enable it and choose the filters (e.g. *.txt *.htm *.html) and the content plugin (internal tc plugin contains a text comparison tool).Make it possible (by checkbox) to ignore different styles of newlines in Commands/Synchronize Dirs...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Indeed but not in the most convenient way. For me, it could be seen only as a temporary workaround. What you say, kind of diminishes the purpose of the "compare contents" tool. Personally, i still think lbrozovsky's request is a useful one.ghisler(Author) wrote:This is already supported, just use the compare plugin by clicking on the >> button behind the "By content" checkbox.
- Wanderer -
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
- ghisler(Author)
- Site Admin
- Posts: 50486
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Sorry, I don't understand your reply. What doesn't work this way?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC
That the current process to enable the "ignore different newlines" is awkward and different from every other option of the SyncTool.ghisler(Author) wrote:Sorry, I don't understand your reply. What doesn't work this way?
That the plugin element of the SyncTool doesn't really make sense, since one would expect it to be available to the CompareTool and not a single person has been inclined to write an additional plugin for the SyncTool - not even the programs Author.
That the [tc.compare as text] isn't named according to it's function, and if it was an actual "plugin" would be available to be used for any filter. And it's not available for use in a normal filter as it doesn't function like any other filter plugin.
That filters are "available" to the SyncTool only if you want to enable that single [tc.compare as text] "plugin", and otherwise every other single filter you try to add is ignored for filtering what files should actually be compared.
That the whole process is completely inconsistent with the compareTool, and previous usage of the filters in any other place in TC.
That there is no option/button/way to display or not display the files (within the compareTool) that wind up being matches as "TXT=". It gets grouped globally into the general "[ = ]" button.
Or maybe wanderer isn't saying that, perhaps I'm just reading between the newlines.
ghisler(Author) wrote:Sorry, I don't understand your reply. What doesn't work this way?
I think this is very close to what i mean. One may see that two files he expects to be the same, have different sizes. The first instinct would be to use the "file comparison" tool, not the "sync dirs" tool. It just seems a little awkward (as Balderstrom points out) to go that way, kind of a "workaround" for a missing functionality. It's not that it doesn't work, it's just awkward.Balderstrom wrote:one would expect it to be available to the CompareTool
Would it cause any problems/difficulties if such a functionality was added in the "file comparison" tool (perhaps in Edit mode)?
- Wanderer -
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
-
- Junior Member
- Posts: 3
- Joined: 2010-11-19, 05:46 UTC
ghisler: It's great! I did not notice this feature in the change list and I was using 7.50 which did not contain it (or I did not see it there).
The only problem I noticed is that it does not work when one of the dirs is a temporary dir (a dir inside a 7zip file).
It's really not as straightforward as clicking an "ignore new lines" box, but for me it does not matter and this solution has more possibilities.
The only problem I noticed is that it does not work when one of the dirs is a temporary dir (a dir inside a 7zip file).
It's really not as straightforward as clicking an "ignore new lines" box, but for me it does not matter and this solution has more possibilities.
- ghisler(Author)
- Site Admin
- Posts: 50486
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
The reason why I implemented it this way: I'm getting requests from people who want that the compare tool ignores some lines at the beginning, or a release date within the file, or tabstops etc. With this plugin solution (and my sample plugin), it's quite easy to add such special wishes.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
@ghisler, Thank you, but is it possible for me to describe step-by-step how to implement ignoring crlf/lf differences?
For now I'm starting "Synchronize directories", then click on ">>" button, then press "Add" button, then enter file filter and press "Define" button. Here press "Plugins tab".
Please help what to enter here, to make possible ignoring crlf/lf differences!
For now I'm starting "Synchronize directories", then click on ">>" button, then press "Add" button, then enter file filter and press "Define" button. Here press "Plugins tab".
Please help what to enter here, to make possible ignoring crlf/lf differences!