Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a folder called lessons and 34 nested lessons in this folder

course\

 lesson1\updatedfile.html
 lesson2\updatedfile.html
 ...
 lesson34\updatedfile.html

The lessons folder contains just the folders for individual lessons. The individual lesson folders contain lots of files but the only ones I want to update are all named the same thing but the updates themselves are not the same. That is to say every updatedfile.html is different. I want to use 7zip to archive to a .zip file where the contents look like this

 course\lessonx(34 folders)\updatedfile.html

This way when I email these updates the guy can just copy and paste the main course folder over the current one and merge will handle all the specific locations.

Any idea how to do this?

share|improve this question
    
Which OS are you using? I'm assuming Windows because of the backslash. But still, which version? –  Dennis Dec 23 '11 at 16:16

2 Answers 2

up vote 2 down vote accepted

Either of the following will do:

  1. Open a command prompt, go to the course directory an execute

    "%ProgramFiles%\7-Zip\7z" a updates.zip lesson*\updatedfile.html
    
    1. Search for updatedfile.html in the built-in Windows search.
    2. Select all matches.
    3. Peform a right click and go through the 7-Zip dialogue.
share|improve this answer
    
By adding arguments for 7z you won't need to go through the dialog and can automate this process. –  music2myear Dec 23 '11 at 16:49
    
I found a round-about solution using portable ant renamer + cmd line "dir >file.txt" then notepadd++ to do a rectangle edit to strop down to just folder names. Saved that as a directory.lst file and imported it into ant renamer to reanme 34 empty folders, then used windows search and drug the 34 files over. I would like to know a fully 7zip solution that would ignore all other files. –  lazfish Dec 23 '11 at 17:19
2  
Am I missing something? Solution 1 is pure 7zip, nothing else. –  Dennis Dec 23 '11 at 17:21
    
@lazfish: I included a commandline version along with some old time favorites. –  surfasb Dec 23 '11 at 20:38
    
I had assumed your method would not create the folder in the 7zip archive. I don't know why. It looks like it works great. Also how would you proceed if instead of lesson01, lesson02 etc, your lesson folder names were completely unique? –  lazfish Dec 29 '11 at 19:44

I like the above method.

  1. It doesn't require remembering command line switches.
  2. Creative use of Search Results
  3. Noob friendly

That being said, the command line example is such:

"%programFiles%\7-zip\7z a updates.zip updatedfile.html -r

the -r tells it look through all subfolders.

Edit:

Old DOS tricks:

dir accepts two switches:

/b lists only the filename. Handy for outputting to a file. /s lists through subfolders.

Hope that helps.

share|improve this answer
    
That does help. Thanks! –  lazfish Dec 29 '11 at 19:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.