Help with Copy and Replace/Merge

Joined
Mar 2, 2021
Messages
13
Reaction score
0
Points
1
I am aware of the Merge function but this does not work for me since I need to always replace the files and not keep the newest version of the file.

I am looking for a replace method similar to windows.
 
Joined
Jan 1, 2009
Messages
15,529
Reaction score
3,892
Points
113
Location
Winchester, VA
Your Mac's Specs
MBP 16" 2023 (M3 Pro), iPhone 15 Pro, plus ATVs, AWatch, MacMinis (multiple)
Welcome to the forum.

I don't understand your post at all. Merge function of what? What application, what do you mean by "replace the files and not keep the newest version of the file?"

What Mac do you have? What version of macOS is it running? What application are you using? What is it you are trying to do? What are you merging? And what do you mean "replace method similar to windows?"
 
OP
P
Joined
Mar 2, 2021
Messages
13
Reaction score
0
Points
1
Welcome to the forum.

I don't understand your post at all. Merge function of what? What application, what do you mean by "replace the files and not keep the newest version of the file?"

What Mac do you have? What version of macOS is it running? What application are you using? What is it you are trying to do? What are you merging? And what do you mean "replace method similar to windows?"
Ty for the fast reply and the welcome message. Sorry if my post was not explained well.

I am using finder. I am trying to copy/paste through finder. For example I have a folder named "test" on my Mac OS Drive with the following files
- 1.txt (with date 19/01/2020)
- 2.txt (new file does not exist in the "test" folder on another drive see below)

And another folder on a different drive named also "test" on my external drive which contains
- 1.txt (with date 30/01/2020)
- 3.txt
- 4.txt

I want to drag and drop (or copy paste with keyboard or any other way does not matter as long the job is done) the folder from the Mac OS drive to the external

The end result should be
- 1.txt (with date 19/01/2020)
- 2.txt
- 3.txt
- 4.txt

same process should be applied on all folders/subfolders which are contained in the "test" folder.
On windows OS this is done by default when replacing files. Replace function on mac os replaced the whole folder which means it will delete the files from the destination. Merge function on mac os does not replace older files, it always keeps the newest version of the file.

hope it is clear now
 
Joined
May 21, 2012
Messages
10,758
Reaction score
1,198
Points
113
Location
Rhode Island
Your Mac's Specs
M1 Mac Studio, 11" iPad Pro 3rd Gen, iPhone 13 Pro Max, Watch Series 7, AirPods Pro
What is the difference between the two different 1.txt files besides the date? And why not use the newer date file?

I know when I try to to merge folders, I get asked if I want to Replace, Overwrite, or Keep Both files for every file with the same name.
 
Joined
Jan 1, 2009
Messages
15,529
Reaction score
3,892
Points
113
Location
Winchester, VA
Your Mac's Specs
MBP 16" 2023 (M3 Pro), iPhone 15 Pro, plus ATVs, AWatch, MacMinis (multiple)
Yep, that's better. The security on macOS is different and tries to protect you from accidentally overwriting what you may not want to replace. What I would do to accomplish what you want is to open "test" on the target drive (where everything will end up) and then in a new Finder window open test in the source drive (in your example, the one with files 1, 3 and 4). Now select all in the source drive by either clicking on the top once, then move to the bottom, hold Shift and click so that all are highlighted, or by using CMC-a to select all. Now you have several option to copy these files--you can drag them from one window to the other, or you can use CMD-C to copy them and then click in the target window and CMD-V to paste them, or you can use the Finder menu on the top bar to select Edit and "Copy" in the source window and then move to the target and select Edit and Paste.

In either case when there is an existing file with the same name, as Bob indicated, the system will ask if you want to replace what is already in the target area or keep both or cancel the copy. Pick what you want. If you say "keep both" then the moved file will have a number appended to differentiate the names, so in your example the moved 1.txt file will become "1 2.txt" where the "2" indicates it is the second file of that same name.

One more way to make what you want, if the file list is short, is not to select 1.txt from the source if you don't want to overwrite 1.txt on the target. But if the list is long, I understand the difficulty, so you can just let the system alert you each time.

EDIT: One challenge is that the options you are offered don't include a "Continue" but just to Keep Both, Overwrite or Stop. But if you always want the source to overwrite the destination, you just select that and it happens. So basically, if you want to keep the older, then keep both, then sort by filename and the two will be next to each other and you can delete the one you don't want.
 
Last edited:
OP
P
Joined
Mar 2, 2021
Messages
13
Reaction score
0
Points
1
I am using latest Bir Sur OS on my mac mini m1.

If i select all the content files of the "test" folder and paste them I do get the "Keep Both" and "replace"
but what happens to the subfolders? will they get replaced or will it react the same way as the previous method (copy / paste the folder and not the contents, as explained above)?
 
OP
P
Joined
Mar 2, 2021
Messages
13
Reaction score
0
Points
1
^ replacing inner (sub)folders does not work, it replaces the whole folder which means in data loss in my case.

Source
test
-1.txt
-subfolder
--2.txt

Destination
test
-1.txt
-subfolder
--2.txt
--3.txt

will result in
test
-1.txt
-subfolder
--2.txt

To give you a better understanding what I'm dealing with is update packages. That means I have many update patches folders that need to be transferred to the installation folder to replace the destination files but also keep the other files/subfolders intact.
 
Joined
Jan 1, 2009
Messages
15,529
Reaction score
3,892
Points
113
Location
Winchester, VA
Your Mac's Specs
MBP 16" 2023 (M3 Pro), iPhone 15 Pro, plus ATVs, AWatch, MacMinis (multiple)
You could write an automator script, I suppose, to do that, but I don't use Automator that much so I can't help you there.
 
OP
P
Joined
Mar 2, 2021
Messages
13
Reaction score
0
Points
1
You could write an automator script, I suppose, to do that, but I don't use Automator that much so I can't help you there.
That would be a really bad solution. Isn't there any alternative to Finder that supports windows-like replace function?
 
Last edited:

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top