dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 10 of 10

Thread: Unzip a file thru VB 6.0

  1. #1
    Join Date
    Dec 2003
    Posts
    52

    Unzip a file thru VB 6.0

    I have an application written in VB 6 that opens a zip file, unzip the file to a folder and process the file. The structure of the file is like this: after each line there is an “OA”. I am getting this file from a 3rd party vendor. They zip the file using a product called Info Zip. In my system I have winzip32.exe. So using my program when I unzip the file, the structure of the file changes, that is after each line there is an “ODOA”. How do I unzip the file without changing the file?
    I have the unzip code as

    Dim cmdline As String
    Dim HInstance As Long
    Dim ZippedFile As String
    DQ = Chr(34)
    On Error GoTo ERRORHANDLER
    cmdline = DQ & Winzipdir & DQ
    cmdline = cmdline & " -e -o "
    cmdline = cmdline & DQ & TheFile & DQ
    cmdline = cmdline & " " & InputDir

    HInstance = ExecCmd(cmdline)
    Exit Sub

    Thanks,
    Sinni.

  2. #2
    Join Date
    Apr 2004
    Location
    Lafayette, LA
    Posts
    200
    Are you openning this file with a windows text editor?
    If so, that is where the OD or carriage-return character is coming from.
    I have not experienced winzip itself adding any characters to the unzipped file.

  3. #3
    Join Date
    Dec 2003
    Posts
    52
    Right after I unzip the file, I am opening the file with "hexview.exe" to look at the structure of the file and find the OD in there.
    I checked with the 3rd party vendor who provides the file and their opinion is that the info zip is not compatible with winzip32, but I am not sure about it.
    They zip the file using info zip and I am unzipping the file thru winzip32, so I don't know that could be a problem.
    If anyone else have any suggestions, please help me.

  4. #4
    Join Date
    Apr 2004
    Location
    Lafayette, LA
    Posts
    200
    I know WinZip uses the standard PKZip protocol. I don't know about Info Zip.
    Are you seeing the OA character using hexview before the file is unzipped? If so, then the unzipping process may be adding this character as a valid action.
    If nothing else, you could add code to your program to remove the OD characters form the file after it is unzipped. Or, you could get a copy of Info Zip.

  5. #5
    Join Date
    Dec 2004
    Location
    Atlanta, Ga.
    Posts
    25

  6. #6
    Join Date
    Dec 2003
    Posts
    52
    When the vendor zip the file using "info zip", in the file after each line there is only "OA"

    After I unzip the file using "winzip32.exe", in the file after each line there is "ODOA".

    As you suggested, if I add the code to my program to remove OD from the file, I think it's going to take a long time to process, because on a daily basis I am getting 9 files and they are pretty big files.

    Is there any options I could add to my code? I mean to overwrite existing file, we use -o, for secret password we use -s, is there any options like this?

    Thanks,
    Sinni.

  7. #7
    Join Date
    Apr 2004
    Location
    Lafayette, LA
    Posts
    200
    Why is the carriage-return a problem?

  8. #8
    Join Date
    Dec 2003
    Posts
    52
    When we receive the input files, my program splits out the file using different criteria and sends out to different clients and they get the files thru a specific program and OD is not accepted there.

  9. #9
    Join Date
    Apr 2004
    Location
    Lafayette, LA
    Posts
    200
    Have you tried the link suggested by cody3?

  10. #10
    Join Date
    Dec 2003
    Posts
    52

    Smile

    The issue with unzipping file has been resolved. The vendor has to turn off the option to translate OA to ODOA.

    Thank you all for your help.

    Thanks again,
    Sinni.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center