I'm trying to combine two trees into one. The problem seems to be that I can't use FULL paths but partial paths because the extraction path will be different every time. So the first folder that exists in both trees triggers the "duplicate filename" error.
What I would like is that test2.txt in Tree2 should overwrite the one in Tree1. And when extracted the folders SUB1 and SUB2 should exist in the root of the output folder.
This is the simple version of the command I've been trying to tinker with:
7Zaa-rTESTING.\FOLDER1\*.\FOLDER2\*
(default dir when running the command is C:\TEST)
Please tell me if this is just impossible to achieve with the current 7Zip functionality or is there some neat solutions that I have completely missed?
Thank You.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Also: "What I would like is that test2.txt in Tree2 should overwrite the one in Tree1"
I forgot to mention that the file: "FOLDER2\SUB1\test2.txt" is newer than the file: "FOLDER1\SUB1\test2.txt", so I want the older overwritten by the newer file.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is not a solution, but a workaround. Ok, you propose to compress entire directories - nice, but what if I need only a couple of files from them, and not the whole contents? Here is a typical example:
C:\Films\Dramas\list.txt
C:\Films\Comedies\list.txt
C:\Films\Movies\list.txt
C:\Films\Westerns\list.txt
C:\Films\Thrillers\list.txt
…
All directories contain, along with 'list.txt', several dozen video files I do not want to compress.
The most logical solution would be to put them all into a list file, and feed the latter to the archiver. But alas, 7za fails to process such a list file, and this definitely is not a good feature.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2010-07-07
zmey_:
that is not a workaround: as I specced I want partial paths, but not the FOLDER1 or FOLDER2 parts.
This works, but looks pretty ugly. I have hoped that there were easier ways of doing this:
Hi folks,
I'm trying to combine two trees into one. The problem seems to be that I can't use FULL paths but partial paths because the extraction path will be different every time. So the first folder that exists in both trees triggers the "duplicate filename" error.
Example:
Tree2:
C:\TEST\FOLDER2\SUB1\test2.txt
What I would like is that test2.txt in Tree2 should overwrite the one in Tree1. And when extracted the folders SUB1 and SUB2 should exist in the root of the output folder.
This is the simple version of the command I've been trying to tinker with:
(default dir when running the command is C:\TEST)
Please tell me if this is just impossible to achieve with the current 7Zip functionality or is there some neat solutions that I have completely missed?
Thank You.
7Za a TESTING FOLDER1\ FOLDER2\
Thanks, ipavlov, but the subs SUB1 and SUB2 needed to be in the root of the archive. That command line will result in:
oops. made a typo, and I don't see the edit button.. so here's the correct listing (the problem is still the same):
Also: "What I would like is that test2.txt in Tree2 should overwrite the one in Tree1"
I forgot to mention that the file: "FOLDER2\SUB1\test2.txt" is newer than the file: "FOLDER1\SUB1\test2.txt", so I want the older overwritten by the newer file.
> 7Za a TESTING FOLDER1\ FOLDER2\
This is not a solution, but a workaround. Ok, you propose to compress entire directories - nice, but what if I need only a couple of files from them, and not the whole contents? Here is a typical example:
C:\Films\Dramas\list.txt
C:\Films\Comedies\list.txt
C:\Films\Movies\list.txt
C:\Films\Westerns\list.txt
C:\Films\Thrillers\list.txt
…
All directories contain, along with 'list.txt', several dozen video files I do not want to compress.
The most logical solution would be to put them all into a list file, and feed the latter to the archiver. But alas, 7za fails to process such a list file, and this definitely is not a good feature.
zmey_:
that is not a workaround: as I specced I want partial paths, but not the FOLDER1 or FOLDER2 parts.
This works, but looks pretty ugly. I have hoped that there were easier ways of doing this:
cheers..
Where's the edit button?.. Let's try quote next:
if exist testing.* del testing.*
cd FOLDER1
xcopy /y /e /l /d *.* ..\FOLDER2\*.* | find /v "File(s)" >..\list.1
..\7Za a ..\testing @..\list.1
cd ..\FOLDER2
xcopy /y /e /l /d *.* ..\FOLDER1\*.* | find /v "File(s)" >..\list.2
..\7Za a ..\testing @..\list.2
cd ..