Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Extracting but not Overwriting!

Help
2004-11-03
2012-12-07
  • I would like to be able to extract multilple *.7z files contaning simmiler files with different dates in to one folder without older files of the same name not overwriting newer files

    7za x *.7z -oC:\DIR -???

    ------------------------------------------

    Another Issue I would like to test a group of files that all begin with the fourth letter always being 0

    7za t ???0* (did not work)

     
    • BTW, Im Using ver 410beta on XPSP2

       
    • Igor Pavlov
      Igor Pavlov
      2004-11-04

      > 7za x *.7z -oC:\DIR -???

      No way

      >7za t ???0* (did not work)

      What is archive name?
      And give error information from 7-zip.

       
    • Sorry my question was not clear. I'll try again?

      The Archives have a naming structure simmiler to this: All archives contain the files of the same name, but different dates and versions.

      0000-Archive0.7z
      0010-Archive1.7z
      0020-Archive2.7z
      0030-Archive3.7z
      0040-Archive4.7z
      0050-Archive5.7z
      0051-Archive5.2.7z
      0052-Archive5.2.7z
      0060-Archive6.7z
      etc. etc...

      I do not want older files over writing newer files.

      So the code I use goes like this.

      7za t "???0*"
      if "%ERRORLEVEL%"=="2" echo There is a problem testing
      7za x "???0*" -o%TEMP%\0000 -aoa
      if "%ERRORLEVEL%"=="2" echo There is a problem extracting
      xcopy %TEMP%\0000\*.* E:\ /D /E /V /C /I /H /R /K /Y
      rmdir /S /Q %TEMP%\0000

      This method above works. Although it requires extracting to a temp folder first. It seems 7z could have done this?

      The process is this:
      1.)Extract multiple 7z files to a single directory. These files are .dll files so it is important to keep the most current version.

      ---------------------------------------------
      7za t ???0* (did not work)  It needed quotation marks since the files had long names.

       
      • Igor Pavlov
        Igor Pavlov
        2004-11-04

        > 7za t ???0* (did not work)

        It must work. Check again.

         
    • >> 7za t ???0* (did not work) 

      >It must work. Check again.

      I did! It don't work?
      It scans every file. Instead of just scanning only the files with the 4th digit = 0.

      Im using 7za version 4.10b with WinXPSP2

      (This works though): 7za t "???0*"

       
    • >> 7za t ???0* (did not work) 

      >It must work. Check again.

      I did! It don't work?
      It scans every file. Instead of just scanning only the files with the 4th digit = 0.

      Im using 7za version 4.10b with WinXPSP2

      (This works though): 7za t "???0*"

      Can you help cleanup the code above?

       
    • I made an error? Above the wrong code was stated multiple times?

      For file names like this:
      0000-Archive0.7z
      0010-Archive1.7z
      0020-Archive2.7z
      0030-Archive3.7z
      0040-Archive4.7z
      0050-Archive5.7z
      0051-Archive5.2.7z
      0052-Archive5.2.7z
      0060-Archive6.7z
      etc. etc...

      These codes do not work:
      7za t ???0* (or) 7za t "???0*"

      This code does work
      7za t ???0-*

      Why the Dash mark is a problem? I could only guess?

      Sorry again for the confusion?

       
      • Igor Pavlov
        Igor Pavlov
        2004-11-04

        In 7-Zip '?' now can mean empty character. I don't remember why I wrote such code.
        Does '?' mean always one character in Linux?
        If so, probably I must change that code.

         
        • my space
          my space
          2004-11-04

          For Unix (and for DOS ?), '?' means one and only one character.

          For Unix '*' means N characters (with N>=0).

           
    • Any way to clean-up this code?

      7za t "???0*"
      if "%ERRORLEVEL%"=="2" echo There is a problem testing
      7za x "???0*" -o%TEMP%\0000 -aoa
      if "%ERRORLEVEL%"=="2" echo There is a problem extracting
      xcopy %TEMP%\0000\*.* E:\ /D /E /V /C /I /H /R /K /Y
      rmdir /S /Q %TEMP%\0000