Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By gimbal2

Thread: Strategy to change file extension and read library

  1. #1
    mikeymoo is offline Member
    Join Date
    Sep 2014
    Posts
    3
    Rep Power
    0

    Default Strategy to change file extension and read library

    I need to be able to select a file (compressed), change its file extension (to zip) and load all its content, preferably as objects. If it makes things easier one can assume all these files to be of the same type.

    The content of the zip file are placed in folders, known Beforehand which might make things easier.

    Any help here would be greatly appreciated.

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: Strategy to change file extension and read library

    ... why? The extension has absolutely no effect on your ability to be able to open it as a zip file. Java is the best example of that; a .jar file is also simply a zip file.

    Or is it actually NOT a zip file and your real question is how to convert files using different compression schemes to zip files? Changing the extension is not magically going to do that.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    mikeymoo is offline Member
    Join Date
    Sep 2014
    Posts
    3
    Rep Power
    0

    Default Re: Strategy to change file extension and read library

    Thanks for the Quick reply.

    You are probably right. What I have is a matlab .slx file which I want to be able to manipulate outside of Matlab.

    What I know is that I can browse the file manually by changing the .slx to .zip.
    Inside I will find 3 folders containing mostly xml-files which are of interest.

    Maybe I dont even need to change the extension which might help me later on. But I dont know how to manipulate the slx file outside of Matlab, xml seems fairly well documented and I could tweak some of the open source software into doing the kind of manipulations that I want and get a well formed document back in the end. Thats why I want to look into this strategy further.

  4. #4
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: Strategy to change file extension and read library

    so those .slx files are also actually zip files in disguise.

    Try creating a simple Java application using the ZipInputStream or ZipFile classes and try to read one of those .xls files without changing anything; I'm pretty sure it will just work.
    mikeymoo likes this.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  5. #5
    mikeymoo is offline Member
    Join Date
    Sep 2014
    Posts
    3
    Rep Power
    0

    Default Re: Strategy to change file extension and read library

    Thanks I will give that a try!

Similar Threads

  1. Replies: 0
    Last Post: 12-31-2013, 05:46 AM
  2. how to read a file and change its contents.
    By mointariq in forum New To Java
    Replies: 1
    Last Post: 04-30-2012, 07:19 PM
  3. Replies: 3
    Last Post: 06-21-2011, 04:51 PM
  4. save file based on file extension
    By masa in forum AWT / Swing
    Replies: 4
    Last Post: 05-11-2010, 11:17 AM
  5. Regex for file extension
    By gapper in forum New To Java
    Replies: 1
    Last Post: 01-31-2008, 03:59 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •