Unzip single zipped file into parts? - file

I have a single file that is zipped. I want to unzip this, but I don't have enough space on the computer. Is there a way to unzip it in parts? For example, first I'd want to unzip the first quarter (or x GB), then stop, look at the resulting file, delete it, and then unzip the next part. The parts do not have to fit together perfectly to form a new file.
I'm using Windows.
EDIT
The original pre-zipped file is only 1 file. This single file was zipped, and now I need to unzip it, but in parts.

Assuming it's a text file:
I'm not sure how to do this natively in Windows, but this is very easy to do under unix. You can download Cygwin which will give you access to the unix tools that can do this.
Then you can do:
/cygdrive/c/yourDisk/
$ zcat yourFile.zip | sed -n 1,1000p > file1.txt
This will give you the first thousand lines in a file in c:\yourDisk\file1.txt

Use your Windows Explorer to explore the zip file... it allows you to open subdirectories (folders) and for you to navigate anywhere within the zip as if it was a normal folder.
When you find something you want to view, either double click it, or drag it to another location in your drive. If you drag it, you will end up copying whatever you are dragging to a new location (say, your temporary work area). Note, copying is not the same as moving as the original compressed version will continue to exist within the zipped folder.
When you have finished with whatever you dragged out, you can delete it (the copy) and return to your original and pull out more data/files for inspection.
Look at my attached image... notice the directory path where I have the red arrow. It says I opened a file called myzipfile.zip (I did a right mouse button over the file and clicked Open With... and selected Windows Explorer).

Related

Update file across multiple folder locations?

I need something that can copy a specified file any and everywhere on my drive (or computer) where that file already exists; i.e. update a file. I tried to search this site, in case I'm not the first, and found this:
CMD command line: copy file to multiple locations at the same time
But not quite the same.
Example:
Say I have a file called CurrentList.txt, and I have copies of it all over my hard drive.  But then I change it and I want all the copies to update.  So I want to copy the newer one over all the others.  It could 'copy if newer', but generally I know it's newer, so it could also just find every instance and copy over it.
I was originally going to use some kind of .bat file that would have to iterate over every folder seeking the file in question, but my batch file programming is limited/rusty.  Then I looked to see if xcopy could do it, but I don't think so...
For how I will use it most, I generally know where those files are going to be, so it actually might be as good or better if I could specify it to (using example), "copy CurrentList.txt, overwriting all other copies wherever found in the C:\Lists folder and all subfolders".
I would really like to be able to have it in a context menu, so I could (from a file explorer) right click on a file or selected files and choose the option to distribute it.
Thanks in advance for any ideas.
Use the "replace" command...
replace CurrentList.txt C:\Lists /s

Running SAVE AS using a batch file

I have a batch file that creates text files in multiple folders.
What I need it to do as well, is after creating that text file, save a copy of it as a .scr file
If I were to do with this without a batch file, I would open the text file, click SAVE AS and save the file with a .scr extension. I cannot figure out how to add this feature to my batch file however.
The original text file cannot be erased, so I can't just change the extension. I would have to copy it, then change the extension, or imitate the SAVE AS feature.
Help?
I just used the ren *<> *<> command. It is extremely redundant because I end up making two text files that are identical and just changing one, but it gets the job done

Navigating a Zipped Filesystem

I have found that, with some file zippers like 7-Zip, it is possible to use files inside the created archives. For example, if I create a file my-zip-file.7z, containing folder my-folder, with files this-file.docx and that-file.html I can use 7zip to go into my-zip-file.7z and open the 2 files, and see or change the contents, even if the original my-folder is deleted! How is this possible?
If you look at the file path for whatever you're editing you'll see that the document is saved to a temporary folder. When you save (or possibly close) 7-Zip then updates the zip file with the saved content.

How to remove specific characters from a file name?

I have bunch of files that need to have a (.) dot removed from the file-name. Eg. "Mr.-John-Smith.jpg" to "Mr-John-Smith.jpg". I don't have real experience with programming and know only html/css and a little javascript. I found another identical question here on stackoverflow, but what I gathered it was fixed on linux system and BASH was used.
Anyways, if anyone could provide me a tutorial on which program to use for this and what code to execute in that program to make it happen I'd be grateful.
if you are using a windows environment (which i guess you do)
you can download this free utility to mass change file names !
main page :
http://www.bulkrenameutility.co.uk/Main_Intro.php
download page :
http://www.bulkrenameutility.co.uk/Download.php
its easy to use
enjoy
If your file names in a file...
1- Open Microsoft Word or any text editor. Press ctrl+h and then search "." without quotes then replace it with blank character.
2- It will remove all dots, again bring "." to your file extention such as .jpg , .png searh your file extention for example "jpg" and replace it with ".jpg"
It will works %100, i am using this method everytime.
if they are not in a file and if you want do somethings in your operation systems' file system
Try this program. It is very useful for this operation;
Download
To remove all except the extension dot from all files in a directory, you can use PowerShell that comes with newer versions of Windows, and can be downloaded for older versions;
Line breaks inserted for readability, this should go on one line;
PS> dir | rename-item -newname {
[System.IO.Path]::GetFileNameWithoutExtension($_.name).Replace(".","") +
[System.IO.Path]::GetExtension($_.name); }
What it does is to take the file name without an extension and remove all dots in it, and then add back the extension. It then renames the file to the resulting name.
This will change for example do.it.now to doit.now, or in your case, Mr.-John-Smith.jpg to Mr-John-Smith.jpg.

Creating a batch file to do drag and drop files onto an exe

I have an exe that I can drag and drop another file onto to produce a third file. Unfortunately it seems to accept only 1 file at a time, if I select multiple and drop it doesn't seem to work.
How do I create a batch file to automate the process of dragging a thousand files of .drag extension onto drop.exe?
Thanks!
In Windows, dropping a file on an exe just executes the command line:
fileprocessor.exe "<full path to dropped file>"
So you should be able to just call the exe directly in your batch file, passing the path to each file that you'd like to process.
EDIT: Look into the For batch command to do this for a series of files. You should be able to specify the wildcard and then call the command for each.
For %%a in (*.drag) do fileprocessor.exe "%%~fa"
Evidently, batch files can have multiple objects dropped onto them. See this question. You should be able to adapt the answer to your needs. I do wonder if there is a maximum number of characters that can be passed in, though, so you might not be able to drag thousands of files onto it. Possibly not even hundreds. But definitely multiple.
EDIT: In your comment to dmercredi's answer, you mention wildcards. If you don't need the drag/drop capability and just want to specify *.drag in your batch file, check out this question instead. There are a variety of answers there that may suit your needs.

Resources