I have two folders of text files, some of which have duplicate file names. The _contents_ of those text files, even with the same name, are different. But everything is dependent only on the file names (not on their contents).
Folder A is the master folder containing thousands of A\*.txt files.
Folder B is the folder whose new files (only!) are added to folder A.
That is, if a B\*.txt file name is already in folder A, it's not added.
Only if a B\*.txt file name is NOT already in folder A, is it added.
Folder A always grows but it never contains a duplicate file name from B.
What I need is a list of the files that were in folder B that were not duplicates of what was already in folder A when they were copied/moved.
Is there an easy way to obtain that list which is better than how I'm manually doing it today, which is to make a list of what file names are originally in A and I make a list of the file names in B that are left
after I copy/move the files over without duplication and then I subtract
one list from the other.
Is there an easier way to get that list of what file names are in folder
B that aren't yet in folder A when I move just those files over?
I've been doing this manually but I'm asking if there is a better way.
I have two folders of text files, some of which have duplicate file names. The _contents_ of those text files, even with the same name, are different. But everything is dependent only on the file names (not on their contents).
Folder A is the master folder containing thousands of A\*.txt files.
Folder B is the folder whose new files (only!) are added to folder A.
That is, if a B\*.txt file name is already in folder A, it's not added.
Only if a B\*.txt file name is NOT already in folder A, is it added.
Folder A always grows but it never contains a duplicate file name from B.
What I need is a list of the files that were in folder B that were not duplicates of what was already in folder A when they were copied/moved.
Is there an easy way to obtain that list which is better than how I'm manually doing it today, which is to make a list of what file names are originally in A and I make a list of the file names in B that are left
after I copy/move the files over without duplication and then I subtract
one list from the other.
Is there an easier way to get that list of what file names are in folder
B that aren't yet in folder A when I move just those files over?
I've been doing this manually but I'm asking if there is a better way.
I have two folders of text files, some of which have duplicate file names. The _contents_ of those text files, even with the same name, are different. But everything is dependent only on the file names (not on their contents).
Folder A is the master folder containing thousands of A\*.txt files.
Folder B is the folder whose new files (only!) are added to folder A.
That is, if a B\*.txt file name is already in folder A, it's not added.
Only if a B\*.txt file name is NOT already in folder A, is it added.
Folder A always grows but it never contains a duplicate file name from B.
What I need is a list of the files that were in folder B that were not duplicates of what was already in folder A when they were copied/moved.
Is there an easy way to obtain that list which is better than how I'm manually doing it today, which is to make a list of what file names are originally in A and I make a list of the file names in B that are left
after I copy/move the files over without duplication and then I subtract
one list from the other.
Is there an easier way to get that list of what file names are in
folder B that aren't yet in folder A when I move just those files over?
Is there an easier way to get that list of what file names are in
folder B that aren't yet in folder A when I move just those files over?
I've been doing this manually but I'm asking if there is a better way.
I have two folders of text files, some of which have duplicate file names. The _contents_ of those text files, even with the same name, are different. But everything is dependent only on the file names (not on their contents).
Folder A is the master folder containing thousands of A\*.txt files.
Folder B is the folder whose new files (only!) are added to folder A.
That is, if a B\*.txt file name is already in folder A, it's not added.
Only if a B\*.txt file name is NOT already in folder A, is it added.
Folder A always grows but it never contains a duplicate file name from B.
What I need is a list of the files that were in folder B that were not duplicates of what was already in folder A when they were copied/moved.
Is there an easy way to obtain that list which is better than how I'm manually doing it today, which is to make a list of what file names are originally in A and I make a list of the file names in B that are left
after I copy/move the files over without duplication and then I subtract
one list from the other.
Is there an easier way to get that list of what file names are in
folder B that aren't yet in folder A when I move just those files over?
Is there an easier way to get that list of what file names are in
folder B that aren't yet in folder A when I move just those files over?
When in directory b use this command (double the % if used in a batch program):
for %i in (*.txt) do if not exist ..\a\%i copy %i ..\a\
Maybe you want to use "move" instead of "copy"
But maybe the simplest way is to use file explorer and copy all
files of b/ to a/ and select don't replace existing files.
List of NOT duplicate files
On 3/13/2023 1:13 AM, Herbert Kleebauer wrote:
Is there an easier way to get that list of what file names are in
folder B that aren't yet in folder A when I move just those files over?
When in directory b use this command (double the % if used in a batch program):
for %i in (*.txt) do if not exist ..\a\%i copy %i ..\a\
Maybe you want to use "move" instead of "copy"
But maybe the simplest way is to use file explorer and copy all
files of b/ to a/ and select don't replace existing files.
I should have been clear that I can easily copy (or move) the files selectively because the native Windows command has an overwrite yes/no.
What I need is a separate _list_ of what was moved (or copied) over.
for %i in (*.txt) do if not exist ..\a\%i copy %i ..\a\
echo %i > list.txt
What I do now is compare time stamps of the resulting combined folder.
But sometimes the time stamps aren't what I would have thought they'd be.
On 3/13/2023 3:08 AM, Neil wrote:
List of NOT duplicate files
"NOT duplicate"" = Unique? :)
On 3/13/2023 4:06 PM, Mr. Man-wai Chang wrote:A list of file names in a folder:
On 3/13/2023 3:08 AM, Neil wrote:
List of NOT duplicate files
"NOT duplicate"" = Unique? :)
It doesn't really matter what the contents of the files are.
I only brought up the contents being different because a dumb move wouldn't work because that would overwrite files of the same name in A with the new contents of another file of the same name from B.
A is the master folder.
B is just the new files (some of which may have the same name and hence
would be discarded).
I should also be clear the copy (or move) isn't the problem because Windows already won't copy over the file in A if it has the same name as in B.
What I'm after is the _list_ of files that were copied (or moved) over from
B to A (those are all going to be file names which were not in A prior).
Kind of like this pseudish code snip
cd B
for %i in (*.txt) do if not exist ..\a\%i copy %i ..\A\
echo %i >> list_of_file_names_in_b_not_in_a.txt
I don't even need to do the copy/move because that's the easy part.
The hard part for me is getting a list of file names in B not already in A.
What I do now is compare time stamps of the resulting combined folder.
But sometimes the time stamps aren't what I would have thought they'd be.
You just answered your own question (but don't use the name
"list.txt" or it will also be listed as new text file):
While in directory b\ enter at the command prompt (but first
delete new.log if it already exists):
for %i in (*.txt) do if not exist ..\a\%i echo %i>>new.log
Or make a batch file which first changes the working
directory to b\, deletes new.log if it already exists
and then executes the above line (but double any %).
Then it doesn't matter where the batch is located and
you can start it with a double click with the mouse.
I've been doing this manually but I'm asking if there is a better way.You might use meld.
I have two folders of text files, some of which have duplicate file names. The _contents_ of those text files, even with the same name, are different. But everything is dependent only on the file names (not on their contents).
Folder A is the master folder containing thousands of A\*.txt files.
Folder B is the folder whose new files (only!) are added to folder A.
That is, if a B\*.txt file name is already in folder A, it's not added.
Only if a B\*.txt file name is NOT already in folder A, is it added.
Folder A always grows but it never contains a duplicate file name from B.
What I need is a list of the files that were in folder B that were not duplicates of what was already in folder A when they were copied/moved.
Is there an easy way to obtain that list which is better than how I'm manually doing it today, which is to make a list of what file names are originally in A and I make a list of the file names in B that are left
after I copy/move the files over without duplication and then I subtract
one list from the other.
Is there an easier way to get that list of what file names are in folder B that aren't yet in folder A when I move just
those files over?
On 3/12/23 15:08, this is what Neil wrote:
I've been doing this manually but I'm asking if there is a better way.You might use meld.
I have two folders of text files, some of which have duplicate file
names.
The _contents_ of those text files, even with the same name, are
different.
But everything is dependent only on the file names (not on their
contents).
Folder A is the master folder containing thousands of A\*.txt files.
Folder B is the folder whose new files (only!) are added to folder A.
That is, if a B\*.txt file name is already in folder A, it's not added.
Only if a B\*.txt file name is NOT already in folder A, is it added.
Folder A always grows but it never contains a duplicate file name from B.
What I need is a list of the files that were in folder B that were not
duplicates of what was already in folder A when they were copied/moved.
Is there an easy way to obtain that list which is better than how I'm
manually doing it today, which is to make a list of what file names are
originally in A and I make a list of the file names in B that are left
after I copy/move the files over without duplication and then I subtract
one list from the other.
Is there an easier way to get that list of what file names are in
folder B that aren't yet in folder A when I move just those files over?
meld <folder A> <folder B>
It will highlight all the files that are not in A. Also it will
highlight all the files that are in both but the text in them is diff.
On 14/03/2023 12:41, Big Al wrote:Yes.
On 3/12/23 15:08, this is what Neil wrote:
I've been doing this manually but I'm asking if there is a better way.You might use meld.
I have two folders of text files, some of which have duplicate file names. >>> The _contents_ of those text files, even with the same name, are different. >>> But everything is dependent only on the file names (not on their contents). >>>
Folder A is the master folder containing thousands of A\*.txt files.
Folder B is the folder whose new files (only!) are added to folder A.
That is, if a B\*.txt file name is already in folder A, it's not added.
Only if a B\*.txt file name is NOT already in folder A, is it added.
Folder A always grows but it never contains a duplicate file name from B. >>>
What I need is a list of the files that were in folder B that were not
duplicates of what was already in folder A when they were copied/moved.
Is there an easy way to obtain that list which is better than how I'm
manually doing it today, which is to make a list of what file names are
originally in A and I make a list of the file names in B that are left
after I copy/move the files over without duplication and then I subtract >>> one list from the other.
Is there an easier way to get that list of what file names are in folder B that aren't yet in folder A when I move
just those files over?
meld <folder A> <folder B>
It will highlight all the files that are not in A. Also it will highlight all the files that are in both but the text
in them is diff.
Presume you mean
- http://meldmerge.org/
-
Regards
wasbit
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 297 |
Nodes: | 16 (2 / 14) |
Uptime: | 05:07:53 |
Calls: | 6,666 |
Files: | 12,213 |
Messages: | 5,335,948 |