I would like to zip two .Txt files in java

hi all,
i would like to zip two temporaray files(.Txt) in java

Do you want to write a part of it yourself or do you want us to prepare you a complete solution? I provided you with a link to Java's zipping tutorial. If you took the effort to read it, you'll know there is an example zip.java.
You can put the initialisation in your main, take what's in the for loop, put it into a function. I assume you can write a program that takes 2 command line parameters, and pass those params to your zip function and you've got it... That's how far I'll go for your solution!

Similar Messages

  • I would like to read a text file in which the decimal numbers are using dots instead of commas. Is there a way of converting this in labVIEW, or how can I get the program to enterpret the figures in the correct way?

    The program doest enterpret my figures from the text file in the correct way since the numbers contain dots instead of commas. Is there a way to fix this in labVIEW, or do I have to change the files before reading them in the program? Thanks beforehend!

    You must go in the labview option menu, you can select 'use the local
    separator' in the front side submenu (LV6i).
    If you use the "From Exponential/Fract/Eng" vi, you are able to select this
    opton (with a boolean) without changing the labview parameters.
    (sorry for my english)
    Lange Jerome
    FRANCE
    "Nina" a ecrit dans le message news:
    [email protected]..
    > I would like to read a text file in which the decimal numbers are
    > using dots instead of commas. Is there a way of converting this in
    > labVIEW, or how can I get the program to enterpret the figures in the
    > correct way?
    >
    > The program doest enterpret my figures from the text file in the
    > correct way since the numbers contain dots instea
    d of commas. Is there
    > a way to fix this in labVIEW, or do I have to change the files before
    > reading them in the program? Thanks beforehend!

  • In Address Book, I would like to have a field "File As". So, l can list "Joe Smith", as "The Smith Family". I will use this when I print labels for Xmas cards and such. Thanks!

    In Address Book, I would like to have a field "File As". So, l can list "Joe Smith", as "The Smith Family". I will use this when I print labels for Xmas cards and such. Thanks!

    In Address Book, I would like to have a field "File As". So, l can list "Joe Smith", as "The Smith Family". I will use this when I print labels for Xmas cards and such. Thanks!

  • I would like to import two different cf cards from two different cameras into the same project/folder and have them be in order of the times they were taken, is there a trick?

    I would like to import two different cf cards from two different cameras into the same project/folder and have them be in the order of the times they were taken, any ideas on how to do this?

    Just import them normally and sort the project by date. They will fall into place. If you tried this and it isn;t happening then make sure the data and times on the two cameras are identical and make sure you are sorting by date and time and nothing else.

  • I would like to upload a excel file using jsp

    Hi,
    I would like to upload the excel file using jsp in my netbeans ide. Please help.
    I don Know what is the error in this jsp file. It is not showing any thing and the file is also not getting uploaded.
    Please gothru the code below.
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <%@ page import="java.io.*" errorPage="err.jsp"%>
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="<html:rewrite page="/design.css" />" rel="stylesheet" type="text/css">
    <title>Upload Page</title>
    </head>
    <body onKeyDown="DisablingBackFunctionality()" onLoad="DisablingBackFunctionality()">
    <html:form action="download" >
    <div style="position:absolute; left:100;top:200;">Select an excel File :<input type="file" name="uploadfile"></div>
    <div style="position:absolute; left:190;top:250;"><input type="submit" name="Submit" value="Read"></div>
    <div style="position:absolute; left:336;top:250;"><input type="reset" name="Reset" value="Clear"></div>
    mainmenu
    </html:form>
    </body>
    </html>
    <%
    String contentType = request.getContentType();
    if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0)) {
    DataInputStream in = new DataInputStream(request.getInputStream());
    int formDataLength = request.getContentLength();
    byte dataBytes[] = new byte[formDataLength];
    int byteRead = 0;
    int totalBytesRead = 0;
    while (totalBytesRead < formDataLength) {
    byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
    totalBytesRead += byteRead;
    String file = new String(dataBytes);
    //out.println("<br> file :"+file);
    String saveFile = file.substring(file.indexOf("filename=\"") + 10);
    //out.println("<br> savefile :"+saveFile);
    saveFile = saveFile.substring(0, saveFile.indexOf("\n"));
    //out.println("<br> now file1 :"+saveFile);
    saveFile = saveFile.substring(saveFile.lastIndexOf("\\") + 1, saveFile.indexOf("\""));
    //out.println("<br> now file2 :"+saveFile);
    //out.print(dataBytes);
    String ext = "";
    if (saveFile.indexOf(".") != -1) {
    ext = saveFile.substring(saveFile.lastIndexOf("."));
    int lastIndex = contentType.lastIndexOf("=");
    //out.println("<br>lst index of"+lastIndex);
    String boundary = contentType.substring(lastIndex + 1, contentType.length());
    //out.println("<br> boundary"+boundary);
    //out.println("<br> file :"+file);
    int pos;
    pos = file.indexOf("filename=\"");
    //out.println("<br> now 0 :"+pos);
    pos = file.indexOf("\n", pos) + 1;
    //out.println("<br>now 1 :"+pos);
    pos = file.indexOf("\n", pos) + 1;
    //out.println("<br>now 2 :"+pos);
    pos = file.indexOf("\n", pos) + 1;
    //out.println("<br>now 3"+pos);
    int boundaryLocation = file.indexOf(boundary, pos) - 4;
    int startPos = ((file.substring(0, pos)).getBytes()).length;
    int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;
    FileOutputStream fileOut = new FileOutputStream("D:\\" + saveFile);
    //FileOutputStream fileOut = new FileOutputStream(saveFile);
    //fileOut.write(dataBytes);
    fileOut.write(dataBytes, startPos, (endPos - startPos));
    fileOut.flush();
    fileOut.close();
    session.setAttribute("fil", saveFile);
    //out.println("File saved as " +saveFile);
    %>
    <script type="text/javascript" >
    function DisablingBackFunctionality()
    var URL;
    var i ;
    var QryStrValue;
    URL=window.location.href ;
    i=URL.indexOf("?");
    QryStrValue=URL.substring(i+1);
    if (QryStrValue!='X')
    window.location=URL + "?X";
    </script>
    Please let me know the result as soon as possible. Its my very urgent.
    Thanking Yu,
    Muthu Kumar.R

    No.
    Mylenium

  • Would like to move iPod touch files to my new Windows 8 computer -- but can not see hidden files

    Would like to move iPod touch files to my new Windows 8 computer -- read on how to do this, but this involves being able to see the hidden fiels -- but can not see hidden files...any suggestions. Would like to transfer these files from iPod Touch to new laptop without software -- is that possible -- if not can anyone recommend a good free software to use?

    There is no way to do so without software. I recently had a similiar task and was suggested to use iExplorer. It worked like a charm. 
    Refer to this page for iExplorer
    Here is the page I was helped with on this task for reference: Export Songs
    Hope this helps!
    PSkilton

  • I would like to combine my word files to a pdf and i get errors for pdfmaker

    i would like to combine my word files to a pdf and i get errors for pdfmaker

    is it 32 bit or 64 bit. you can check it by following the steps mentioned below
    In the program in which you want to verify the version, click the Microsoft Office Button, and then click Program_Name Options.
    Click Resources, and then click About.
    To locate the About Microsoft Program_Name dialog box in programs that do not use the Ribbon user interface,  click About on the Help menu.
    Thanks,
    Vikrantt Singh

  • What is the name of the folders which are your backup of Itunes library? I am recovering from a virus, have no workable desktop in Win XP, but can search and find files and folders. I would like to move these backup files to a new computer

    what is the name of the folders which are the backup of Itunes library? I am recovering from a virus, have no workable desktop in Win XP, but can search and find files and folders. I would like to move these backup files to a new computer, authorize it and sync with Iphone 3Gs and Ipod 5th gen.
    I

    I second the whole iTunes folder approach.
    If for some reason you have split the media folder from the library files then the media folder needs to restored to the same path it used to have while the library files can be copied into the music folder of your new profile.
    If in dobut, backup up the entire Documents and Settings folder before wiping the infected drive, but be selective about what you restore as many viruses drop active components capable of reinfecting the compuer in the temp folders and internet caches. It is much easier to backup more than you need than to discover after the fact that you no longer have access to some vital project you'd been storing in a folder on the desktop.
    tt2

  • I would like to make two separate ca

    I would like to make two separate Calendars in iCalendar.  Tried following directions on "help" but what I get is two calendars that are linked and the same.  How do I get two completely, independent calendars?  Thanks

    I have the same question.  Does anyone have a solution?

  • I would like to store my music files on a external harddrive  when using itunes instead of using my internal drive but cant seem to configure the macbook to do this. can someone tell me how ?

    I would like to store my music files on a external harddrive when using itunes instead of my internal drive but can't seem to configure the computer to do this. can someone tell me how ? .

    Copy the entire /Music/iTunes/ folder to teh external.
    Hold Option and launch iTunes.
    select Choose library... and select the iTunes folder on the external.
    Make sure the external is connected and ready before launching iTunes.

  • I would like to work with DICOM files so I may buy Photoshop CS6 Extended. Can a TIFF be exported from a DICOM file in Photoshop CS6 Extended?

    I would like to work with DICOM files so I may buy Photoshop CS6 Extended. Can a TIFF be exported from a DICOM file in Photoshop CS6 Extended?

    Also, I am looking through the Adobe website, and I can't find any place where Photoshop CS6 Extended is even offered for purchase. Is it extremely well hidden, or is it not available?

  • I would like to read a ASC11 file ?

    I would like to read a ASC11 file ? i would like to read the ASC11 file but there is a 2 lines header in this file.and i dont wanna read this header.this ASC11
    file has 12 columns and then i wanna convert them to
    binary file.
    any example would be great.
    thanks

    i am sorry that you are getting upset due to my repetitions of question.
    well i have looked into example read from text file
    and tried with this but it did not solve my problem.
    in this example this function is reading data line
    by line and i dont want to read the data line by line.
    for this reason i removed the inner while loop.
    to skip the 2 lines header when i call read file
    function 2 times. i still get the header in my result file.
    when i write the data of 12 columns and N number of rows by calling write to binary function,i tried to read this binary data with the help of Matlab. i get
    only one column and it look likes that it is transposed.the output of the read function is 2 dimensional array. i try to write this 2 dimensional
    array by call
    ing write to binary function and i also
    want to display the 2-Dimensional data in 2 dimensional
    indicator array.
    this all things i tried already but could not get the
    desired result. therefore i wrote again.
    any way if you are upset then take my questions back and thanks for your tips.

  • I would like to edit my PDF file how can i do that without deleting it

    i would like to edit my PDF file, how do i do that without deleting it ???

    Hi Didds,
    Through Acrobat you can edit your PDF file.
    Kindly refer this link:PDF editor, edit text in PDF files | Adobe Acrobat XI
    Regards,
    Florence

  • I would like to bring layered Illustrator files into Muse

    I would like to bring layered Illustrator files into Muse.  It would be great to use them for buttons like the photoshop layered button options.
    It would be even better if it just converted the vectors to .SVG files auto-magically, when published.

    Importing .ai files in Muse and having Muse export them as .svg is imperative for future proof workflow.
    But in order for that to happen Muse would have to have some vector capabilities in itself and that means only one thing: rewrite of the whole app, most likely ditching Air framework.
    In other words ain't gonna happen.
    When you think about it really it's the Illustrator or Indesign that should do what Muse is doing right now. There is no reason for Muse to exist but they dont want to confuse the users I guess. Illustrator should apply native CSS effects by default enabled when you work on vectors such as drop shadow, round corners, blur, etc. and have it generate .css

  • I would like to import the .abcdp files from my old, restored HD (was running mountain lion when the mac crashed) to the addressbook of my new mac (10.9.5)

    I would like to import the .abcdp files from my old, restored HD (was running mountain lion when the mac crashed) to the addressbook of my new mac (10.9.5).
    Please advise.

    I don't have access to one.
    I don't understand why the new address book is not backwards compatible with the data from former OS X versions.
    In 10.8. preview was still able to read the files although it was already impossible to import them into the address book. But Why?

Maybe you are looking for