Does anybody know of any way (on Windows) to create an archive (zip, rar,..) and adding files to it by importing a list of files to be added (say from a CSV or text file or simply pasted) that need to be archived. Say I have a simple list of 1,000 files across multiple directories that I want to add to an archive, this would be a much simpler method of doing it than adding each file individually. Also I do not want to arhive the entire directory as it is absolutely massive.
eg:
c:\somedir\file1.php
c:\somedir\somesubdir\file2.php
c:\someotherdir\file3.php
...
And no I do not want to import all files in certain directories, the hundreds of files are scattered across tens of directories which also contain lots of other files that I do not want to archive.
Thanks
rar.exe from WinRAR has the following option:
n#<list> Include files listed in specified list file
Related
Is there a loop I can use to create .xlsx files from .bracken files I currently have and channel them into an output folder?
All that I have now is to convert my .bracken files into .xlsx files using this code cat MG-ABCD12345-0.genus.bracken > MG-ABCD12345-0_genus_bracken.xlsx and files are going into my current working directory. I would like the output in a folder called bracken_excel_files which is located within my current working directory. I would prefer to use common commands such as for for the loop for easier understanding.
bracken appears to be generating/sharing the same output format as kraken, which I saw somewhere to be tab-delimited fields.
If that is true, then that is the essence of what CSV files are.
In that case, you don't need to use the "cat" command (CPU and I/O consuming). You simply need to rename the file with a ".csv" suffix (to make the file format explicitly visible for others), then import that into Excel or OpenOffice/LibreOffice Calc. Each of those tools offer different options for interpreting the input when you use the "Import" function to open the files.
I've been trying to copy files from one directory to another and then changing all the files I moved into .txt files. The only problem is that there are multiple, probably 30+ different extensions and hard coding them is not an option because there could be different extensions in different output folders. I've been able to move all the files from one to another pretty easily, but being able to change every extension in a folder (.ser, .pbr, etc,) to a .txt has proven difficult. If anyone could help that would be great. This is my code for moving files from one folder to another so I just need to be able to change the files to .txt either while they are being moved or after they've been copied to the new folder.
src = 'L:/Development/DCS/UL/Dev\202209\1_202206_4355_4359/OUTPUT/202112'
trg = 'L:/Development/DCS/UL/Dev/Test Output'
files=os.listdir('L:/Development/DCS/UL/Dev/202209/1_202206_4355_4359/OUTPUT/202112')
# iterating over all the files in
# the source directory
for fname in files:
try:
# copying the files to the
# destination directory
shutil.copy2(os.path.join('L:/Development/DCS/UL/Dev/202209/1_202206_4355_4359/OUTPUT/202112',fname), 'L:/Development/DCS/UL/Dev/Test Output')
except:
print ("error")
pass
I have a zip file which I extract to a folder. I then need to open the files and perform various functions but the files are not modified or saved at all.
I use Dotnetzip to extract the files from the archive before the files are opened and viewed etc.
Is there a way to compare the files, which was extracted, to the files still inside the zip file without extracting those files again? The zip files I have is quite large. Some of them several 100 Mb's so don't want to wait for another extraction process again.
Thanks!
Is it possible to use multiple p4alias files, like one personal p4alias file and one project related? I do not see a way to source or concatenate multiple files.
Practical answer: not really, no -- you should just copy and paste the project alias file into your personal alias file. A fun trick here is to keep the aliases file in the depot, so you can use merging to pull project-level changes into your personal file without having your own changes go back.
Impractical answer: run something in the background that will concatenate the files together for you and surface them as a single p4aliases file, e.g. https://superuser.com/questions/762590/can-i-create-a-symlink-esque-file-to-merge-two-files-together
Does anyone know if it is possible to get the name of files inside a rar/zip without having to unrar/unzip the file.. and if yes, is there a way to block it or make difficult..
Thanks
The file names in a zip file are visible even if the data is encrypted. If you want to hide the names, the easy solution is to zip the zip file encrypted.
Later versions of PKZip do have an option to encrypt the file names as well with –cd=encrypt. (cd means central directory.)
The -l flag to unzip(1) does just that:
-l
list archive files (short format). The names, uncompressed file sizes and modification dates and times of the specified files are printed, along with totals for all files specified.
unrar(1) has the l option:
l
List archive content.