Hi all,
this is my first and i can't speak english well, so please be kind !
Here is my problem :
I want to unzip a list of .zip files stored in one directory, so I though about using that :
unzip '*.zip'
Thing is that all of my zipped folders contain a file with the unique same name : Doc.kml
eg : zipfile1.zip --> Doc.kml
zipfile2.zip --> Doc.kml
zipfileAB.zip --> Doc.kml
So, every unzipping process erase the precedent one...
What I want to do is unzipping all my files (zipfile1.zip,...) by mentionning the name of the unzipped zile (eg not Doc.kml but zipfiles.kml, zipfile2.kml, etc...)
-n never overwrite existing files. If a file already exists, skip
the extraction of that file without prompting. By default unzip
queries before extracting any file that already exists; the user
may choose to overwrite only the current file, overwrite all
files, skip extraction of the current file, skip extraction of
all existing files, or rename the current file.
thanks, I had noticed this.
But, unless typing manually the file name (for hundreds of files!), is it possible to do it more automatically?
I thought using a loop but I don't how to script it
Archive: STR_SUB.zip
replace DOC.kml? [y]es, [n]o, [A]ll, [N]one, [r]ename: r
new name: STR_SUB.kml
inflating: STR_SUB.kml
Archive: ATC.zip
replace DOC.kml? [y]es, [n]o, [A]ll, [N]one, [r]ename: r
new name: ATC.kml
inflating: ATC.kml
Explaining it with words : both zipped files STR_SUB.zip and ATC.zip contain a file named DOC.kml.
When asking replace "DOC.kml?" I type "r" then the name of my zipped files + .kml (eg : ATC + . kml)
Why wouldn't it be possible to do it automatically since I got a question for each zipfile using the name of the archive ?
example : something that could copy the filename ATC in ATC.zip and paste it into ATC.kml while extracting shall be possible, right?
Maybe the unzip function mey not be appropriate to do such a thing?!