Question - unzipping files
When saving files many of them seem to get zipped. When I click on them to try and open them there is a momentary flash and then the zip appears as before. How do I open these files? Mart Bi
This is a 7Zip command issue. You need to set the zip command correctly. If you do not know how to use 7zip then post in the 7zip forum.
You can get the arguments from 7zip "7z /?"
¯\_(ツ)_/¯
Similar Messages
-
Stuck on overwrite question unzipping files
Hi guys!
I've created a script that extract zip files (7z and zip extensions) but i've got a problem with overwriting.
Clear-Host
Function Find-Files(){
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,Position=0)][string]$Path,
[Parameter(Mandatory=$true,Position=1)][string]$Code
$Test=0
$WorkFiles=@()
$Unzipped=@()
$AllFiles=Get-ChildItem -Path $Path -Recurse -File
foreach( $item in $AllFiles|Where{ $_.Name -like "sin*.dat" } ){
$WorkFiles+= $item.FullName
$ZipFiles=$AllFiles|Where{($_.Extension -eq ".7z") -or ($_.Extension -eq ".zip")}
if( $ZipFiles.Length -ne 0 ){
$Test=1
Set-Alias 7zip "$env:ProgramFiles\7-Zip\7z.exe"
$Directory="D:\ZTemp"
if((Test-Path $Directory) -eq $false){
mkdir $Directory
foreach ($Zip in $ZipFiles){
$Name=$Zip.BaseName
$Destination=$Directory,$Name -join('\')
if( Test-Path $zip.Name ){
Write-Error "Sono presenti Cartelle compresse con nomi uguali $Destination" -Category SecurityError
$Unzipped+= $Zip.FullName
$foreach.movenext()
#continue
cd $Zip.Directory.FullName
7zip 'x' $Zip.Name "-o$Destination"
$ExtFiles= Get-ChildItem $Destination -File -Recurse|Where-Object{ $_.Name -like "sin*.dat"}
if ($ExtFiles.count -eq 0){
Remove-Item $Destination -Recurse -Force
else{
foreach ($item in $ExtFiles){
$WorkFiles+=$item.FullName
cd $env:HOME
$i=2
$Pattern="Total Cutting Time for Each Tool"
$Excel = New-Object -ComObject excel.application
$Excel.visible=$false
$WorkBook= $Excel.workbooks.add()
$WorkSheet= $WorkBook.worksheets.item(1)
$WorkSheet.cells.item(1,1)="Codice"
$WorkSheet.cells.item(1,2)="Quantità"
$WorkSheet.cells.item(1,3)="Progetto"
$WorkSheet.cells.item(1,4)="N° elementi"
$WorkSheet.cells.item(2,4)=$WorkFiles.Length
foreach ($item in $WorkFiles){
$Breaches=(Select-String -Path $item -Pattern "not Used").LineNumber
$Line=(Select-String -Path $item -Pattern $Pattern).LineNumber
$Lines=(Select-String -Path $item -Pattern $Code).LineNumber
$Count=0
foreach ($Number in $Lines){
if($Number -gt $Line){
$Count=$Count+1
if( $Breaches -ne $null ){
if($Number -eq $Breaches[0]){
$Count-=1
if($Number -eq $Breaches[1]){
$Count-=1
$Count=$Count/2
$Project=((Select-String -Path $item -Pattern "Project Definition").Line -split(':'))[1]
$WorkSheet.cells.item($i,1)=$Code
$WorkSheet.cells.item($i,2)=$Count
$WorkSheet.cells.item($i,3)=$Project
$i=$i+1
$Excel.Cells.EntireColumn.AutoFit()
$WorkBook.saveas("get-files",51,[Type]::Missing,[Type]::Missing,$false,$false,1,2)
$WorkBook.close()
$Excel.quit()
if ($Test -eq 1){
Remove-Item $Directory -Recurse
Write-Output "Procedura Conclusa con Successo"
function Button ($Title,$Path, $Code) {
[void][System.Reflection.Assembly]::LoadWithPartialName( “System.Windows.Forms”)
[void][System.Reflection.Assembly]::LoadWithPartialName( “Microsoft.VisualBasic”)
#####Define the form size & placement
$form = New-Object “System.Windows.Forms.Form”;
$form.Width = 500;
$form.Height = 150;
$form.Text = $title;
$form.StartPosition = [System.Windows.Forms.FormStartPosition]::CenterScreen;
##############Define text label1
$textLabel1 = New-Object “System.Windows.Forms.Label”;
$textLabel1.Left = 25;
$textLabel1.Top = 20;
$textLabel1.Text = $Path;
##############Define text label2
$textLabel2 = New-Object “System.Windows.Forms.Label”;
$textLabel2.Left = 25;
$textLabel2.Top = 55;
$textLabel2.Text = $Code;
############Define text box1 for input
$textBox1 = New-Object “System.Windows.Forms.TextBox”;
$textBox1.Left = 150;
$textBox1.Top = 10;
$textBox1.width = 200;
############Define text box2 for input
$textBox2 = New-Object “System.Windows.Forms.TextBox”;
$textBox2.Left = 150;
$textBox2.Top = 50;
$textBox2.width = 200;
#############Define default values for the input boxes
$defaultValue = “”
$textBox1.Text = $defaultValue;
$textBox2.Text = $defaultValue;
#############define OK button
$button = New-Object “System.Windows.Forms.Button”;
$button.Left = 360;
$button.Top = 85;
$button.Width = 100;
$button.Text = “Ok”;
############# This is when you have to close the form after getting values
$eventHandler = [System.EventHandler]{
$textBox1.Text;
$textBox2.Text;
$form.Close();};
$button.Add_Click($eventHandler) ;
#############Add controls to all the above objects defined
$form.Controls.Add($button);
$form.Controls.Add($textLabel1);
$form.Controls.Add($textLabel2);
$form.Controls.Add($textBox1);
$form.Controls.Add($textBox2);
$ret = $form.ShowDialog();
#################return values
return $textBox1.Text, $textBox2.Text.ToUpper()
$return= Button “Ricerca Codici” “Enter Path” “Enter Code”
$StartDTM=Get-Date
Find-Files -Path $return[0] -Code $return[1]
$EndDTM=Get-Date
"Elapsed Time: $(($EndDTM-$StartDTM).totalseconds) seconds"
launching this script i'm stuck here:
Please tell me how to go ahead with this problem.
Thanks
AThis is a 7Zip command issue. You need to set the zip command correctly. If you do not know how to use 7zip then post in the 7zip forum.
You can get the arguments from 7zip "7z /?"
¯\_(ツ)_/¯ -
Unable to unzip files , unable to move apps into the app foldercant update
I cannot unzip files. Also if i try to install a new app by dragging it to the applications folder it says "that files already exists".
also if i try to update with software update it gives an error. i tried running verify disk permissions and repair disk permissions but this did nothing please help i am scared cuz my last time machine was along time ago.Not to worry.
A few clarification questions first.
What exactly does the dialog say when you try to drag a new app to the applications folder? Is it something like, "an older version of this already exists in this location, do you want to replace it with the version you are moving?"
And, what application are you attempting to use to unzip files? -
Unzip file from froms then load
i have form (basically called loader) which read text file and then load it in data base.
Now,there is a user requirement that if text file is in zip format then he can unzip file using form.
Any idea how to do this can some unzip software used at back end.
I mean any idea any suggestion is required.
Forms 6i i am using.The zip.exe and unzip.exe are shipped with Oracle products, they are found under %ORACLE_HOME%/bin
just type zip or unzip in a command line session and you'll get all the switches and details.
Judging from your first post I understand you are running in C/S mode, if not you need to use CLIENT_HOST from webutil instead of HOST. It's the same concept.
As for HOST built-in example, I told you, there are very nice and detailed examples in the online help of Forms builder.
Open Forms builder and either press Ctrl + H or click on the big blue question mark, or open help menu and click on "Online Help".
Tony
Message was edited by:
Tony Garabedian -
Unzip files from a folder which is updating regularly using multithreading
Hi All,
I have acode which unzip all the files from a folder .This code picks up all the zipped files at a time and then unzip it and write them to another folder but now my requirement is changed ,suppose the source folder where all the zipped files are present is refreshed or updated with new zipped files regularly then how can I implement in my code multithreading to get several files by threads and send it for unzipping.
Please suggest with some example or edit my code.
package com.myprojcet;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
public class Main {
* Extracts a zip file
public void extractZipFile() {
try {
String zipFileName = "C:\\soft\\test"; //Source folder for zipped files
//Create input and output streams
File SourceDir = new File(zipFileName);
File[] zipFiles = SourceDir.listFiles();
ZipInputStream inStream = null;
OutputStream outStream = null;
ZipEntry entry;
byte[] buffer = new byte[1024];
int nrBytesRead;
//Get next zip entry and start reading data
for(int i=0; i < zipFiles.length; i++) {
inStream= new ZipInputStream(new FileInputStream(zipFiles));
while((entry = inStream.getNextEntry()) != null) {
outStream=new FileOutputStream("C:\\soft\\test2\\"+entry.toString()); //destination folder for unzipped file
while ((nrBytesRead = inStream.read(buffer)) > 0) {
outStream.write(buffer, 0, nrBytesRead);
//Finish off by closing the streams
outStream.close();
inStream.close();
} catch (IOException ex) {
ex.printStackTrace();
* @param args the command line arguments
public static void main(String[] args) {
new Main().extractZipFile();
Thanks
Sumit
Edited by: user8687839 on Feb 27, 2012 11:00 PMBut my question is that if in a source folder we have several files which are in zipped format and the folder is getting updated every min (say) with new zipped files (which are dumped from some outside environment).I need to unzip all the files present in the folder ,if new one comes there then also check for the new zipped file and unzip it.You don't need to keep re-stating that.
I had written a code for unzipping a file from a folder (thinking the folder is not updated everytime).Or that.
Now I am thinking of using threads because if I create suppose 5 threads and every threads poll the source folder and pick up a zip file ,send it for unzipping it and again poll the source folder for any new entries?Or that.
If using the threads here hits performace then what should I use?Err, what you presently have?
Provide me any sample code or link that would be more useful.You've already written it. -
Execute Process Task error-Unzip Files
Dear All,
I have a SSIS package, that downloads a Zip file from FTP Server and extract and load that information in Sql Server Table. In my case every time I have only one file in FTP Server. There is no possible to get multiple files from FTP Server.
While at the time of executing SSIS package getting error at Execute Process Task(Unzip Files) i.e
Error Description :In Executing "F:\7z\7z.exe" " x F:\ZipFiles\Sales_010815.zip -oF:\ZipFiles\" at "", The process exit code was "2" while the expected was "0".
This error message getting while unzip my file.
Can some one help on this issue.
Regards,
Praveen C.
Regards, PraveenHi Praveen,
After testing the issue in my environment, I find the issue is caused by the code in Arguments is incorrect.
To fix this issue, please refer to the code below:
x F:\ZipFiles\Sales_010815.zip -oF:\ZipFiles
The following screenshot is for your reference:
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
HI,
i am trying to unzipping files from external sdcard..
i am using zipme.jar, but when i am deploying this application it give error.
please nay one hep me to unzipping files using 3rd-party jarBut my question is that if in a source folder we have several files which are in zipped format and the folder is getting updated every min (say) with new zipped files (which are dumped from some outside environment).I need to unzip all the files present in the folder ,if new one comes there then also check for the new zipped file and unzip it.You don't need to keep re-stating that.
I had written a code for unzipping a file from a folder (thinking the folder is not updated everytime).Or that.
Now I am thinking of using threads because if I create suppose 5 threads and every threads poll the source folder and pick up a zip file ,send it for unzipping it and again poll the source folder for any new entries?Or that.
If using the threads here hits performace then what should I use?Err, what you presently have?
Provide me any sample code or link that would be more useful.You've already written it. -
Unzipping Files in the wrong folder
Hi
I am trying to unzip files. It works fine except that it unzips the files at the root. So i have tried specifying the path for making the directory (in which the unzipped files are stored). But that doesnt seem to work. Now i am unable to find the unzipped files. CAN ANYONE HELP PLEASE
public static void unzipFile(String zFile)
Enumeration entries;
ZipFile zipFile;
try {
zipFile = new ZipFile(zFile);
File file = new File(zipFile.getName());
String fname = file.getName();
String substr1 = fname.substring(0, fname.indexOf("."));
String filepath = "/data/psawant/temp";
File dir = new File(filepath, substr1);
try {
dir.mkdir();
catch (Exception fe)
System.err.println("Unhandled exception:");
fe.printStackTrace();
return;
entries = zipFile.entries();
while(entries.hasMoreElements()) {
ZipEntry entry = (ZipEntry)entries.nextElement();
if(entry.isDirectory())
// Assume directories are stored parents first then children.
System.err.println("Extracting directory: " + entry.getName());
(new File(entry.getName())).mkdir();
continue;
} //end of if
System.err.println("Extracting file: " + entry.getName());
copyInputStream(zipFile.getInputStream(entry),
new BufferedOutputStream(new FileOutputStream(entry.getName())));
} //end of while
zipFile.close();
} catch (IOException ioe) { }
} //end of unzip function
public static final void copyInputStream(InputStream in, OutputStream out)
throws IOException
byte[] buffer = new byte[1024];
int len;
while((len = in.read(buffer)) >= 0)
out.write(buffer, 0, len);
in.close();
out.close();
Any help is apprciated
ThanxSorry I got it this time. I had overlooked the new File. I added that & it works fine but there seems to be some problem
If the folder has another folder inside . it doesnt show that one. or rather just unzips one folder & no folders inside it. But i guess i can check for that
Thanx for u r help
Have a nice day -
Hi,
I have a requirement to retrieve a zip file from the FTP Server, unzip it to the SAP Server and process the unzipped files. Retrieving the data from the FTP server should work via FTP commands which can be executed from within an ABAP program. However, the problem is unzipping these files via ABAP and put them on the server as well. 1. How to do this from within an ABAP Program? (unix commands?)
2. Can I unzip these files with or without using the folder structure? (additional parameter for unix command?)
Kind regards,
Micky.REPORT ZTESTUNIX line-size 400
no standard page heading.
selection-screen begin of block ucmd with frame title text-001.
parameters: unixcom like rlgrap-filename. " ...SAP Interface file
selection-screen end of block ucmd.
data: begin of tabl occurs 500,
line(400),
end of tabl.
data: lines type i.
start-of-selection.
refresh tabl.
call 'SYSTEM' id 'COMMAND' field unixcom
id 'TAB' field tabl[].
describe table tabl lines lines.
loop at tabl.
write:/01 tabl-line.
endloop.
skip 2.
if lines = 0.
write:/ 'NO Occurances were found'.
else.
write:/ 'Command was successfully executed' color col_total.
write:/ 'Number of entries in Search' color col_total,
lines color 6.
endif.
end-of-selection.
while running give the command as
<b>unzip test.zip -x dir</b>
then it will unzip test.zip file to dir called dir.
you can specify the filepath instead of file...
regards
vijay -
Question on File Content Conversion
Hi all,
I went through this blog(/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1) for File content conversion and I have a question regading File Content Conversion. Is it always neccessary to have the data type structure as File, Record, Row and then the fields. Is it always neccesary to maintain this level of hierarchy for File content conversion to work.Hi Sonia,
For FCC sender or receiver if you want text with delimieter / csv file process.
use the below parameters
You would have to use the Document name ,namespace,record set name ,record strucutre name ( and occurrences also) and processing parameters in Sender side
In receiver side Record structre, processing parameters.
see below links to have more details..
/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
/people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/harrison.holland5/blog/2006/12/20/xi-configuration-for-mdm-integration--sample-scenario /people/shabarish.vijayakumar/blog/2006/04/03/xi-in-the-role-of-a-ftp
/people/prateek.shah/blog/2005/06/14/file-to-r3-via-abap-proxy
/people/mickael.huchet/blog/2006/09/18/xipi-how-to-exclude-files-in-a-sender-file-adapter -
Regards
Chilla -
I am trying to unzip a file using java.util.zip. It is throwing a ZipException in the first line where I instantiate ZipFile object.
ZipFile oFile = new ZipFile("/myzip.zip");java.util.jar is not working either. It fails right here:
JarFile oFile = new JarFile("/myzip.zip");Here is the exception thrown in the above cases:
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at ReadZipFile.main(ReadZipFile.java:21)
An interesting observation:
I am able to extract the contents of the zip from the command-line using jar utility.
jar xvf myzip.zipI am stumped! I think jar utility internally uses the same classes for unzipping files. How come it is working with jar utility whereas it is not working from Java program? Also, the myzip.zip appears to be a valid archive - I am able to open it with winzip.
Any pointers will be appreciated.
Thanks in advance,
GaneshI think the above reply is correct but didn't explain why you would be getting a file not found. Unless you have your zip file at the root of your harddrive the slash in the filename is improper. Without the slash your code will assume your current working directory and look for the file there.
By putting that forward slash in there you are telling the code to look at the root of the filestructure and NOT at the current working directory. -
Unzip files from FTP using ABAP
Hi All,
I have the a requirement to unzip certain files from ftp and transfer the extracted files to another directory in ftp.
Searched (Re: Unzip file;) in SDN but didnt find the perfect solution
Appreciate the help.
Regards
SivaYou can use IndexOf function
see this example
http://visakhm.blogspot.in/2012/05/package-to-implement-daily-processing.html
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Powershell to unzip file having passowrd
hi, i am using the following script to unzip files it works fine with files not having password
$shell=new-object -com shell.application
$CurrentLocation=get-location
$CurrentPath=$CurrentLocation.path
$Location=$shell.namespace($CurrentPath)
$ZipFiles = get-childitem *.zip
$ZipFiles.count | out-default
foreach ($ZipFile in $ZipFiles)
$ZipFile.fullname | out-default
$ZipFolder = $shell.namespace($ZipFile.fullname)
$Location.Copyhere($ZipFolder.items())
# for password protected file it pops up a windows saying password needed, how can i enter the password in script
#what changes i need to make if i have to extract password protected files.
studentAFAIK, you can't do passwords directly with WScript. You may be able to code up a method to imitate key strokes though.
My suggestion would be to call another command-line utility zip/unzip program like 7-zip:
http://www.7-zip.org/download.html -
How do I fix flashing question-mark-file-icon issue on reboot?
My Mac Book Air 11" has been a bit strange recently, so I decided that a full clean would be a good idea. I had no important files I wanted to keep, so i went ahead and reinstalled the OS. Apparently that doesn't delete everything, so I did some research. Apparently I have to delete the drive. So I did, using the command-r method. I erased my HD and made a new one, but upon reboot I get this flashing-question-mark-file icon. How do I fix this?
After you erased the drive, did you install the OSX?
Ciao -
Can someone please tell me if there is an easy way to unzip files with the hardware/software that comes with an Apple OSX SnowLeopard? If so, I would appreciate very simple step by step instructions as to how to do this as I am fairly ignorant about the Mac systems. I've used PC's for years and this Mac is new to me. Thanks very much for any help.
Respectfully
JimYou mean that's all there is to it?
Wow, that was easy enough. Thanks a million Neil I sure appreciate the help.
Jim
Maybe you are looking for
-
How much HD space should I partician for Windows XP?
I am upgrading to a new (2010) iMac i5 with 1 TB HD and I was wondering how much disc space I should make for Windows XP? I only have a couple of special apps that I use in Windows and the attending files do not take up much space so other than the O
-
Oracle errors in alert.log
Hello guys, I have the following Oracle Release 10.2.0.1.0 server configuration: - Windows 2003 Server SP2 - 3,25 GB RAM (I think that is a 4 GB but this is a windows 2003 standard edition) - 2 Intel Xeon Quad core - 3 disk partitions (C -> 40GB, 25
-
Changing quantities distribution by cost center in MIGO
Hi experts, Sometimes, we create a purchase order and we distribute quantities on several cost centers. Then, in the MIGO transaction, the distribution is made with the quantities indicated in the purchase order. I wish I could change these quantitie
-
Hi How to use "server certificate" to develop HTTPS or SSL proxy server.Can any one give me detail in steps.
-
Mass Processing of Planned orders
Hi all, We can do mass availability check for the planned orders and we can firm the planned orders for which the materials are available through COHV but can we have a output log after the mass processing so that we can see the list of planned order