Synchronize directories: How to compare the files content?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
Cynthia25
Junior Member
Junior Member
Posts: 4
Joined: 2016-04-12, 13:01 UTC

Synchronize directories: How to compare the files content?

Post by *Cynthia25 »

Hello everyone,

I am new at Total Commander and I'd really need your help on something I'm trying to do.
I have two different directories, A and B. Each contains the same number of files and the files have the same name from one directory to the other. For example, if I have "Apple", "Orange" and "Tomato" in A, I'll have "Apple", "Orange" and "Tomato" in B. The difference is that the files have a more recent date in the directory A than in B. Some files have a different content from A to B, but not all.
What I need to do: Compare the content of the files in A and B. Replace, only for the files that have a difference of content, the files in B by the files in A.
The functions in the "Synchronize directories" section don't allow me to do this. Indeed, if I synchronize "by content", then it takes all the new files in A and copies them in B. If I synchronize by content and without regard for the date, it doesn't copy the files that changed content, it just writes the sign unequal.

Thank you in advance for your help!
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

When TC marks files as unequal (even more, it works with any files), you still can override direction by selecting files and opening context menu. TC marks files as unequal instead of some direction because it doesn't know which direction should be set, so it is up to you.
Cynthia25
Junior Member
Junior Member
Posts: 4
Joined: 2016-04-12, 13:01 UTC

Post by *Cynthia25 »

Hi,

Thank you for your reply. I know I can change the unequal sign into something else, but I wish to avoid that because my directories are huge and it would be very long to change these signs manually.
Is there a way to change the parameters of the TC so as to never display the unequal sign and replace it by another sign?
Or is there a way to do what I want to do (as explained in my first post) in another way?

Thank you
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

There is no way to know which file should be treaten as 'better' one when you ignore timestamps.
You can always filter unequal files and then use Ctrl+A to change direction for all of them, but TC doesn't allow to set direction for unequal files automatically.
Cynthia25
Junior Member
Junior Member
Posts: 4
Joined: 2016-04-12, 13:01 UTC

Post by *Cynthia25 »

Thank you for your answer, I think it should address my problem. When you do Ctrl+A it selects all the files. But then, how do you change direction for all of them?

Thank you in advance for your help
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

But then, how do you change direction for all of them?
Ctrl+L or Ctrl+R (depending on the direction)

If I understood your task correctly and it's always the same direction than you don't have to sync at all. Just copy and overwrite.
Cynthia25
Junior Member
Junior Member
Posts: 4
Joined: 2016-04-12, 13:01 UTC

Post by *Cynthia25 »

It's ok I found how. Thank you, it's exaclty what I needed :)

I just have one more question. Is there a limit to the number of files and/or folders in the directories that we want to synchronize?
Thank you,
jcerdeno
Junior Member
Junior Member
Posts: 4
Joined: 2016-05-24, 14:48 UTC

Post by *jcerdeno »

Is it possible to filter the result of the files which has 2 or more differencies? I mean, i do not want to see the files which has just one.

Thanks a lot,
User avatar
Horst.Epp
Power Member
Power Member
Posts: 7022
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

jcerdeno wrote:Is it possible to filter the result of the files which has 2 or more differencies? I mean, i do not want to see the files which has just one.

Thanks a lot,
No, and it would be completely useless
because one difference can also be a large block of lines.
jcerdeno
Junior Member
Junior Member
Posts: 4
Joined: 2016-05-24, 14:48 UTC

Post by *jcerdeno »

Horst.Epp wrote:
jcerdeno wrote:Is it possible to filter the result of the files which has 2 or more differencies? I mean, i do not want to see the files which has just one.

Thanks a lot,
No, and it would be completely useless
because one difference can also be a large block of lines.
It may be completely useless for you... I have hundreds of files with one diff (i know what it is) and i need the files with 2 or more.
User avatar
Dalai
Power Member
Power Member
Posts: 10034
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2jcerdeno
How do you define two differences? Two different characters (on the same line)? Two different lines? Two different blocks? What about a mix of those, e.g. two or more different characters on two different lines? So, you see it's not that simple.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
jcerdeno
Junior Member
Junior Member
Posts: 4
Joined: 2016-05-24, 14:48 UTC

Post by *jcerdeno »

Dalai wrote:2jcerdeno
How do you define two differences? Two different characters (on the same line)? Two different lines? Two different blocks? What about a mix of those, e.g. two or more different characters on two different lines? So, you see it's not that simple.

Regards
Dalai
In this case two different lines, I do not think is simple, I just answered if it is possible than when you synchronize directories, it is possible to filter the one which the "1 difference show"
Post Reply