Problem with Searching file and writing

Hi guys,
i m writing a program to search for a file and if the file exists it will write .
otherwise printing astatement saying file not found.
i m passing directory name as an argument.
in tht there are many ip files.
the program will search for a particular file in all the zip files.
i m passing arguments are
<directory-name> <search-file-name>
the code is finding the particular file but its not writing to another file.
i m getting exception as Filenot found.. the code as follows:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.io.*;
public class SearchFile {
public static void main(String args[]) {      
     try{
     Testme(args[0],args[1]);
     catch(Exception e){System.out.println(e);}
public static void Testme(String lists,String sfile)
     File dir = new File(lists);
File[] children = dir.listFiles();
     int length =children.length;
if (length < 0) {
System.out.println("sorry No files found");
} else {
for (int i=0; i<length; i++) {
// Get filename of file or directory
File fl=children;
          System.out.println("the File name is "+fl.getName());
                    if(fl.getName().endsWith(".zip"))
               //System.out.println("The zipped files are"+filename);
               SearchZip(fl,sfile);
public static void SearchZip(File zipfile,String searchfile)
          //System.out.println("welcome"+zipfile);
          boolean state=false;
try {
     int count=0;
          ZipFile zf = new ZipFile(zipfile);
          System.out.println("----------------------------");
          System.out.println("Searching in "+zipfile);
          Enumeration entries = zf.entries();
          //System.out.println("the passed file File name is "+args[1]);
          while (entries.hasMoreElements()) {
          ZipEntry ze = (ZipEntry) entries.nextElement();
          System.out.println("----------------------------");
          System.out.println("Listing FIles " + ze.getName() );
          String files=ze.getName();
          System.out.println("----------------------------");
          File f = new File("geetha.txt");
          byte[] buf = new byte[8184];
          String inputLine = "y";
          if (inputLine.equalsIgnoreCase("y")) {
               long size = ze.getSize();
               if (size > 0) {
                    System.out.println("name is " files "size is"+ size);
                    BufferedReader br = new BufferedReader(
                         new InputStreamReader(zf.getInputStream(ze)));
                    String line;
                    if(files.equals(searchfile))
                         System.out.println("File Found...............");
                         FileInputStream in = new FileInputStream(files);
                         FileOutputStream out = new FileOutputStream(f);
                         int len;
                    while ((len = in.read(buf)) > 0) {
                         state=true;
                    out.write(buf, 0, len);
                    System.out.println("successfully Written the file");
                    System.out.println("The File Found is "+state);
          catch (Exception e) {
          System.out.println("File Not Found Please check the File"+e);

This is a multipost of http://forum.java.sun.com/thread.jspa?threadID=692507&tstart=0
Please return to that thread Santhosh as you have been given a couple of answers already in that thread.

Similar Messages

  • Problems with .ARW files and auto toning

    problems with .ARW files and auto toning
    let me try to explain this because this has happened in past and never found a way to resolve but i lived with it
    now that I have a Sony A7R the problem is more serious
    Firstly i take pride it making the picture happen all in camera, i use DRO lvl 5 to get enough light, like when i'm shooting at dusk. DRO its like doing HDR but in a single file, it lightens the darks. in my camera i'm happy with results
    but when I upload them to lightroom, they come out near black.
    allow me to explain
    lets say I import 100 images
    i double check my preferences and everything is UNCHECKED when it comes to importing options, there is no auto toning, nothing.
    as the images import i see a preview in the thumbnail which looks fine.
    i double click on one to enlarge it, hence leave grid view.
    for a brief 1 or 2 seconds, i see the full image in all its glory but than lightroom does something funny, it darkens the image
    one by one as it inspects each image, if it was a DRO image it makes it too dark.
    to make this clear, the image is perfect as it was in the beginning but after a few seconds lightroom for some reason thinks it needs to correct it.
    how to prevent lightroom from doing this, i want the image exactly as it is, why must lightroom apply a correction>?
    i think it has to do something with interpreting the raw file and lightroom applies its own algorithm.
    but here is what i dont get.....before lightroom makes the change i'm able to witness the picture exactly as it was taken and want it unchanged..
    now i have to tweak each file or find a profile for it which is added work.
    any ideas how to prevent lightroom from ruining my images and just leave them as they were when first detected...
    there are 2 phases...one is when it originally imports and they look fine
    second is scanning each image and applying some kind of toning which darkens it too much.
    thanks for the help

    sorry thats the auto reply message from yahoo email.
    i've disabled it now
    thing is, there is no DRO jpg to download from the camera
    its only ARW. so my understanding is when i use DRO setting, the camera makes changes to the ARW than lightroom somehow reads this from the ARW.
    but then sadly reverts it to no DRO settings.
    because i notice if i take normal picture in raw mode its dark but if i apply dro to it, it comes out brighter, yet when i d/l the image from camera to lightroom, which is an ARW - there are no jpgs. lightroom decides to mess it up
    so in reality there is no point in using DRO because when i upload it lightroom removes it.
    is there a way to tell lightroom to preserve the jpg preview as it first sees it.
    its just lame, picture appears perfect...than lightroom does something, than bam, its ruined,.
    what do i need to do to prevent lightroom from ruining the image? if it was good in the first place.

  • Error: There is a problem with the file and it cannot be copied

    I've been trying to copy (and essentially move) the contents of an NTFS-formatted external HDD to my iMac's internal HDD so I can then format the external HDD to Mac OS Extended. However, when I simply try to drag and drop, I get an error during the transfer that states:
    There is a problem with the file and it cannot be copied.
    I tried a basic cp command in Terminal to copy all contents of the external HDD to a folder on my iMac's desktop, and found that while there were no errors, there were many individual files missing full chunks of data (ie. original file would be 4GB on my external HDD, but only 350MB on my desktop).
    Any ideas on how I can successfully copy a large amount of data (approx. 170GB) from my external HDD to my internal HDD while avoiding this error, so I can ultimately format my external HDD to Mac OS Extended? ANY help is greatly appreciated.

    That's not a good error to see. It indicates something is very wrong. Pulled out of an old programming header file:
    ioErr = -36, /*I/O error (bummers)*/
    If Apple labelled it "bummers," they had a good reason! Unfortunately, that doesn't bode well for you.
    Try running Disk Utility again. Keep repairing over and over until one of two things happens: 1) Disk Utility says no repair was needed, or 2) Disk Utility reports the same error in two sequential repair sessions and is unable to repair it both times.
    If you hit the second case, or if you hit the first but still can't copy files, then you've got two basic options:
    = Buy a third-party disk utility or two and try them. Try TechTool as a first choice.
    = Recover what files you can and write the rest off as gone.
    = Send your drive to a data recovery service and hope they can extract more than you can.
    Of course, none of this is necessary if you have a backup of the contents of that hard drive. (If you don't, this is your learning experience. Once bitten, twice shy, so they say.) Also, regardless of the outcome, once you've got your data or have decided it's gone, you're going to want to wipe that drive completely clean. Reformat the drive with Disk Utility, then when it's done, select the drive in Disk Utility and hit command-i. (Don't select the new volume you just created on that drive, select the drive itself. Mine looks like "232.9 GB Hitachi ..." with the volume name indented underneath.) Look for an item that says S.M.A.R.T. Status, and if it doesn't say Verified, you might as well throw out the drive. Don't trust any more data to it.
    If all appears safe, you can start moving data back onto it. But, as always, make sure you have a backup of everything!

  • Problem with m3u files and Quicktime

    Hello:
    I have made one update with Quicktime software (version 7.6.9 1680.9). The problem is that Quicktime player reproduces mp3 files but when I try to play m3u files the sound is very bad. It sounds like gargling.
    For example: This files play ok:
    http://www.telefonica.net/web2/sevarra/Sarabande.mp3
    It plays ok when the previous link is introduced as URL address in Quicktime player, but the corresponding m3u files sounds like gargling
    http://www.telefonica.net/web2/sevarra/list0.m3u
    I think there a problem with m3u files and Quicktime.
    Tank you very much and best regards.

    I have discovered that when the URL is playing (with gargling sound) if I open the A/V controls in QT menus and I move the Jog Shuttle or the Speed level then the sound becomes good.
    Yes! Great catch, ttfrank. I can replicate that too.
    Interesting ... if (after getting the sound working properly again) you then pause play of the m3u, and start it again, you get the gargling/dalekish sound quality back again.
    Bug reporting ... there's a couple of ways you can go about doing this. You can use the QuickTime product feedback form:
    http://www.apple.com/feedback/quicktime.html
    ... but if you want to track progress on the bug, try instead registering as an Apple Developer (for free):
    http://developer.apple.com/programs/register/
    ... and then you'll be able to submit the bug via the Apple Bug Reporter:
    http://developer.apple.com/bugreporter/
    In the meantime, there's also a restricted forum available to level 4 and 5 members ("Notable New Technical Issues") where we can report this sort of thing. I'll try to get a post written up on the topic there later today.

  • E-Recruiting: Problems with search profile and serach templates

    Hi Recruiting-Experts,
    I´m facing problems with "Search Profiles" and "Search Templates"
    (Customizing SPRO --> SAP-E-Recruiting --> Recruitment --> Talent Warehouse --> Candidate --> Candidate Search )
    Out customers wants me to add a new search criterion to the talent search. It's a customer-field (type 'd' --> Date)  belonging to infotype 5106.
    Unfortunately, it doesn't work. The hit list is always empty.
    What I did:
    Customizing (see above)
    Updated search profile (report RCF_RECREATE_SEARCH_PROFILES)
    The result:
    I can see and choose the new search criterion on talent warehouse search site (recruiters startpage)
    I can find the data (internal format yyyymmdd) via transaction SKPR07 (see XML below, ZZEARLIEST_ENTRY 20090901)
    By the way, the hit list is also empty when adding and searching for birthdate.
    Has it got to do with the date stored in internal format?
    Thanks for any comments / help.
    Regards
    CHRIS
    =========================================================================

    Hi Sebastian,
    thanks for your quick answer.
    That's why I didn't get it done for hours yesterday.
    Thanks again,
    Regards
    CHRIS

  • Problem with intermittent sampling and writing to file(s)

    I am describing the functionality that I am trying to achieve via the attached VI.
    The VI opens with a sequence structure. In the first sequence step analog output voltages for 2 AO channels are set
    The next sequence step consists of analog data acquisition
    Custom linear scales for 3 input channels are specified, to convert input ‘volts’ to respective physical quantity being measured
    The input voltage signal is with +/- 10V but the physical quantity (forces) are greater than 10N
    The headers for the data files are created as strings
    The acquisition is set for finite sample acquisition
    The VI is set for periodic acquisition, wherein the data is acquired for specific time period given by ‘Sampling on’ and then ignored for time period specified by ‘Interval off’.
    The VI is set to write instantaneous data to multiple files. Each time the While loop is executed the instantaneous data, number of samples read (sampling rate x Sampling on time),  is written to a ‘.dat’ file.
    Statistical operations on data collected for each While loop execution is performed. These values (average & st. dev) are then written to another file ‘*.sum’ with respective headers
    The headers for the ‘*.sum’ file are written only for the first execution of the While loop
    The VI is designed to run for a specific duration after which the execution of  While loop is stopped
    Certain safety features are incorporated to terminate the execution of the While loop if the ratio of measured quantities exceeds a preset limit.
    In the last sequence the analog outputs are set to zero
    I am having following problems with the execution of the VI:
    The VI does not write instantaneous data to data files (*.dat)
    The VI writes the averaged data for *.sum file for only the first execution of the While loop.
    It also truncates the values to around 10.5 written in *.sum file. While implies that the custom scale is not working as intended.
    I would really appreciate if you would tell me how to fix these bugs with the VI. I would really appreciate your help.
    Have a happy holiday season.
    Thanks,
    Dinesh
    Attachments:
    VLBT_Sequence_AnalogIP_2.vi ‏437 KB

    Lynn, he may actually not be to blame for the diagram size. It does not change if you "clean" it, which leads me to believe that this is what he did. But a very entertaining diagram it is. A true case study :-)
    Now, the strange thing is that stuff like this remains in it:
    As Lynn said, the reason why the file is updated only once is that there must be an error after the first acquisition completes. The only way to figure out which one it is (in order to avoid or correct it) is to debug your code in situ (using a probe on the error wires). It might be because you try to restart your acquisition within the loop (you probably should stop it first if you really want to restart it anyhow). I would put the start out of the while loop and try this way. The error might occur elsewhere though or for another reason...
    Since you recreate your dat file at each iteration, the second giving you nothing because of an (unknown) error, will essentially erase your first successful iteration.
    I don't understand the truncation statement.

  • Having a problem with app files and fonts between OS

    I work in a prepress department, and we are have issues with files that are coming from 10.4.11 to 10.5.8. The 10.4.11 is a power PC and the 10.5.8 is Intel. Fonts get corrupt and display as a unix file with 0 file size and application files like Quark loose there ID and come up as a document file. I think this has to do with the OS difference. Is there any way that this can be fixed???

    Well we are having the the same problem with folders. Jobs that are made on a 10.4 Mac, sometimes you can't see the contents of the folder on a 10.5 Mac. And there is no pattern.
    And if you take the contents out of the folder and put it loose using a 10.4 Mac, you can see it on a 10.5 Mac
    Also if we put a .dfont on the end to the font using a 10.4 Mac, you can see the font on a 10.5 Mac.
    This is all very strange. There are no patterns and no reason why one folder would work and the other does not. Just checking if there is something that could be causing a problem between the OS's.

  • Problem with manifest file and Plateau LMS

    I have published a course with a quiz in SCORM 1.2 and tried
    to upload to a Plateau LMS.
    It seems that a "page cannot be found" message is the result
    after upload and we try to launch the course. The course works
    outside the LMS (when run locally on my computer).
    The Plateau LMS support team tried to help, and found the
    following: "There is something wrong with this manifest, though I
    cannot ascertain what that is exactly. Most of the file name is in
    the parameter field, which is causing the launch path to look like
    this:
    /content/apmm/cbcgis/mars/BRTMAIN/MARS?BRT%20Maintenance%20Template_%2020080226.htm=
    Everything in the parameters field is placed after the
    filename in a URLencoded querystring after the question mark that
    you see above. it should look like this:
    /content/apmm/cbcgis/mars/BRTMAIN/MARS BRT Maintenance
    Template_ 20080226.htm"
    Can anyone please help resolve this, or have any advice?
    This is the first time we have tried uploading Captivate
    courses to this LMS, and we have been having problems with the
    manifest file in general. I have looked at all the material I can
    find on publishing and the manifest file, but cannot seem to
    resolve my issue.
    Thanks
    Warwick

    Warwick,
    I have had this error with an Authorware set of SCORM files
    when my LMS was looking for index.htm and I had named it index.html
    - you wouldn't think that would cause an error but it did. I would
    be more than happy to package a Captivate file of just a few
    screens that works on my LMS (which is Learn.com's Learning
    Center), and send you the SCORM files to test... That could be a
    start anyhow. I will send you a private msg. with my e-mail
    id.

  • Problem with CSV file and Ostermiller library

    Hello, I'm using Ostermiller library to generate file with csv format.
    The problem is that this library seems to have a bug when it comes to data including the character carriage return.
    For example I try to record a file with the following data:
    Field1 = Text1
    Field2 = This is
    a long text including
    carriage return
    characters
    Theoritically the file should looks like this:
    Text1,"This is
    a long text including
    carriage return
    characters"
    But the library creates the following:
    Text1, This is\ra long text including\rcarriage return\rcharacters
    The \r you can see in not 0x0D but 0x5C 0x72 !!!!!!
    This is not a correct CSV format and then I cannot reopen the file correctly with Excel.
    Did you already see this problem with this library?
    Any idea?

    Even when i use ExcelCSVPrinter the text appears as -
    5,1,First aid course,234,,"Boeing Everett Plant \nRoom No 108",2007-11-26,02:15:00,,04:15:00,Scheduler S.,Resourcing,,hiii abc
    when I open this text in notepad. It formats properly when I open in excel as follows
    5,1,First aid course,234,,"Boeing Everett Plant
    Room No 108",2007-11-26,02:15:00,,04:15:00,Scheduler S.,Resourcing,,hiii abc
    IS there something else that I need to do?

  • Problem with .prog file and host Executable type

    Hi All,
    Please help as m stuck in some issue. Its related to Unix shell scrip FTP program registered to apps.
    Requirement – Inbound program will run. It’s a request set. Last program in the set is FTP program that will MOVE the data file to archive folder.
    Steps used by me are as below. Plz suggest if m doing anything wrong.
    1)     Wrote the FTP scrip as below
    #default parameters for host concurrent program
    shellnm=$0 #-Shell script name
    usernmpw=$1 #- Oracle username/password
    userid=$2 #- User_id
    ora_user=$3 # - Oracle Applications username
    cnreqid=$4 #- Concurrent request id
    #Move the Data file to archive
    mv -f/apps/prodappl/xxics/11.5.0/bin/inbound/po_file/ICS_PO_IMP.csv /apps/prodappl/xxics/11.5.0/bin/inbound/po_file/backup/ICS_PO_IMP"_"`date +%F``date +%R`".csv"
    2)     Saved it in notepad in .PROG file type. Then keep it in apps BIN directory.
    3)     Register it with apps as HOST executable program name.
    4)     Then created the concurrent program and added to request set.
    5)     While running the request set the FTP program is errored out.
    Plz suggest if I am missing anything………
    Thanks,
    Samir

    Samir,
    5)     While running the request set the FTP program is errored out.What is the error?
    Plz suggest if I am missing anything………Please see if these documents help.
    Note: 156636.1 - How to Register a Host Concurrent Program in Applications
    Note: 266268.1 - How To Create a Custom Concurrent program with Host Method and Pass Parameters to the shell script
    Regards,
    Hussein

  • Problems with properties files and war files in weblogic 5.1

              I work with WebLogic 5.1 and I'm trying to deploy a web application which gets
              a properties file. If I deploy it as an expanded directory hierarchy (with the
              properties files into WEB-INF/classes) I have no problems. While deploying it
              by a .war file I get this message: "en_GB java.util.MissingResourceException:
              Can't find resource for base name Agent, locale en " (the getBundle() method is
              trying to get an english property file). What could I do? Is it really a weblogic
              5.1 bug?
              Thanks,
              David
              

    This issue comes up repeatably. It's a real bug.
              I believe this problem was fixed in a 5.1 service pack, but I'm trying to
              find out the exact disposition of the issue. Noone seems to be complaining
              about this under 6.x, so a fix seems to have been made, the only question is
              whether or not it got back-ported to a 5.1 service pack.
              Gary
              david <[email protected]> wrote in message
              news:3ac4a39a$[email protected]..
              >
              > I work with WebLogic 5.1 and I'm trying to deploy a web application which
              gets
              > a properties file. If I deploy it as an expanded directory hierarchy (with
              the
              > properties files into WEB-INF/classes) I have no problems. While deploying
              it
              > by a .war file I get this message: "en_GB
              java.util.MissingResourceException:
              > Can't find resource for base name Agent, locale en " (the getBundle()
              method is
              > trying to get an english property file). What could I do? Is it really a
              weblogic
              > 5.1 bug?
              > Thanks,
              > David
              

  • Problem  with search help and date fields

    Dear experts,
    I have two text fields and to each i assigned cacs_calendar search help.
    It works well normally but if i make text box output only then i cannot select date.
    I want that text box in its disabled form can be used to select date from cacs_calendar search help
    that i assigned.User should not provide manual input which means fiedls should be otherwise listed in grey.

    Hi Aditya
    If a I/P output field is provided an attribute as output only and though search help is provided , the values in the search help list will also be in read-only mode and u cannot select them at all, may be you can solve ur problem thru different approach.
    when a manual entry is done with wrong value which is not present in F4 help/search help list and
    execution is done SAP will by default throw error saying invalid value

  • Problem with .docx files and Office 2004

    After the upgrade to Snow Leopard, I now am receiving a message "There is not enough memory or disk space to convert." when I try to open a Office 2007/2008 docx file. The error does not happen on all docx files, but only on files over 100kb. The same files that do not work now, all worked prior to upgrading to Snow Leopard. I am using a fully patched Office 2004 (11.5) in addition to the open XML compatibility software 1.1.1 from Microsoft. I have removed all error and duplicate fonts and repaired disk permissions.
    I have looked on both Apple and Microsoft for an answer, but nothing except Microsoft claiming Office 2008 will work seamlessly with Snow Leopard.

    I just came across this problem too. Very frustrating. I just got this new MacBook Pro last week (so I'm using Snow Leopard too). I installed Office 2004, updated it to 11.5, and installed the open XML conversion software, but no dice. I absolutely should have plenty of memory and disk space to do any docx conversion.
    Also, I'm only trying to convert a 20KB docx file, so large file size isn't an issue here. And my copy of Office 2004 is totally legit, in case that's a question.
    I really need to be able to open docx files for work, so this is a real problem for me. Help me, Apple-wan Kenobi!
    Message was edited by: juliamontgomery

  • Problem with search engines and BC

    Hi
    This is what google does when look for my website.  is hosted with BC and this domain is listed on the sites that BC gave me. do I need to elliminate this from the list. if yes, how is that done?  I cannot have a site declared insecured by google!
    Thanks for your response

    In this case, the address listed in the certificate does not match the address of the website your browser tried to go to.
    This is what google is telling me.   I cut and pasted part of the response below:
    One possible reason for this is that your communications are being intercepted by an attacker who is presenting a certificate for a different website, which would cause a mismatch. Another possible reason is that the server is set up to return the same certificate for multiple websites, including the one you are attempting to visit, even though that certificate is not valid for all of those websites. Google Chrome can say for sure that you reached *.worldsecuresystems.com, but cannot verify that that is the same site aswww.alechadesigns.com which you intended to reach. If you proceed, Chrome will not check for any further name mismatches.

  • Problem in reading no. of files and writing into a single file

    Hi,
    Iam with Problem in reading no. of files and writing into a single file....
    Iam reading no. of files stored in local directory.......
    Iam able to read and print the data in files successfully....but while writing..only first file is being written...and the next files are not written in my output file...
    plz tell me my mistake....I hope Iam doing some mistake while writing into file...PLz help.....
    Basically my code structure is like this....
    import java.io.*;
    import java.util.regex.*;
    import java.util.*;
    import java.text.*;
    import org.apache.poi.poifs.filesystem.POIFSFileSystem;
    import org.apache.poi.hssf.usermodel.HSSFWorkbook;
    import org.apache.poi.hssf.usermodel.HSSFSheet;
    import org.apache.poi.hssf.usermodel.HSSFRow;
    import org.apache.poi.hssf.usermodel.HSSFCell;
    class Writing {
    public static void main(String args[]) throws Exception {
              FileOutputStream fileOut = new FileOutputStream("ServerResult.xls"); //my output file
              int counter = 1;
              File dir = new File("C:/Perform/ServerLogs");
              String[] children = dir.list();
              if( children == null)
                   System.out.println("The Directory mentioned does not exist");
              else {
                   for (int fileNo = 0; fileNo < children.length; fileNo++ ) {        //Files iteration starts
                        String filename = children[fileNo];
              File logFile = new File(filename);
    FileReader logFileReader = new FileReader(logFile);
    BufferedReader logReader = new BufferedReader(logFileReader);
    StringBuffer sBuf = new StringBuffer(5000);
              HSSFWorkbook wb = new HSSFWorkbook();          
              HSSFSheet sheet = wb.createSheet();
              HSSFRow rowTitle;
              HSSFRow rowReq;
              HSSFRow rowRes;
    String aLine = null;
    boolean skip = false;
    boolean readed = false;
    boolean initReq = false;
              boolean flag = false;
    long requestTime = 0;
    long responseTime = 0;
    long recdTime = 0;
    long sentTime = 0;
              long hasTime = 0;
              long presentTime = 0;
              int hasCalls = 0;
    Pattern startMessage = Pattern.compile("^<MESSAGE.*ID=\".*_"+args[0]+"\".*", Pattern.DOTALL);
    Pattern requestMessage = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"RequestMsg.\".*ID=\".*_"+args[0]+"\".*<ActName>(.*)</ActName>.*", Pattern.DOTALL);
    Pattern requestMessage1 = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"RequestMsg.\".*ID=\".*_"+args[0]+"\".*<Svc id=\"(.*)\">.*", Pattern.DOTALL);
    Pattern responseMessage = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"ResponseMsg\".*ID=\".*_"+args[0]+"\".*", Pattern.DOTALL);
    Pattern initMessage = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"HostConnInit\".*ID=\".*_"+args[0]+"\".*", Pattern.DOTALL);
    Pattern initResMessage = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"ResponseMsg\".*ID=\"null\".*", Pattern.DOTALL);
    Pattern initResIDMessage = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"ResponseMsg\".*ID=\"null\".*<IATA>"+args[0]+"</IATA>.*", Pattern.DOTALL);
              Pattern sentMessage = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"DCMsgSentInfo\".*ID=\".*_"+args[0]+"\".*", Pattern.DOTALL);
              Pattern rcvdMessage = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"DCMsgRcvdInfo\".*ID=\".*_"+args[0]+"\".*", Pattern.DOTALL);
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
    DecimalFormat dcf = new DecimalFormat("########.##");
    String actName = "";
              if (fileNo ==0)
              rowTitle = sheet.createRow((short)0);
              rowTitle.createCell((short)0).setCellType(HSSFCell.CELL_TYPE_STRING);
              rowTitle.createCell((short)0).setCellValue("Req/Res");
              rowTitle.createCell((short)1).setCellType(HSSFCell.CELL_TYPE_STRING);
              rowTitle.createCell((short)1).setCellValue("Action");
              rowTitle.createCell((short)2).setCellType(HSSFCell.CELL_TYPE_STRING);
              rowTitle.createCell((short)2).setCellValue("Server Time(in ms)");
              rowTitle.createCell((short)3).setCellType(HSSFCell.CELL_TYPE_STRING);
              rowTitle.createCell((short)3).setCellValue("Request Vs Response Time in Server(in ms)");
              rowTitle.createCell((short)4).setCellType(HSSFCell.CELL_TYPE_STRING);
              rowTitle.createCell((short)4).setCellValue("Time Taken By HAS/HOST(in ms)");
              rowTitle.createCell((short)5).setCellType(HSSFCell.CELL_TYPE_STRING);
              rowTitle.createCell((short)5).setCellValue("No. of HAS calls");
              rowTitle.createCell((short)6).setCellType(HSSFCell.CELL_TYPE_STRING);
              rowTitle.createCell((short)6).setCellValue("Data Size");
              //wb.write(fileOut);
    while((aLine=logReader.readLine()) != null) {
    if(aLine.startsWith("<MESSAGE TYPE=\"EVENT\"")) {
    Matcher m = startMessage.matcher(aLine);
    if(m.find()) {
    sBuf.setLength(0);
    sBuf.append(aLine);
    skip = false;
    initReq = false;
    m = initMessage.matcher(aLine);
    if(m.find()) {
    initReq = true;
    } else {
    if(initReq) {
    m = initResMessage.matcher(aLine);
    if(m.find()) {
    sBuf.setLength(0);
    sBuf.append(aLine);
    skip = false;
    } else if(aLine.startsWith("</MESSAGE>")) {
    if(!skip) {
    sBuf.append(aLine);
    readed = true;
    } else if(!skip){
    sBuf.append(aLine);
    if(!skip && readed) {
    String tempStr = sBuf.toString();
    if(tempStr.length() > 0) {
    boolean reqMatched = false;
    Matcher m = null;
    if(initReq) {
    m = initMessage.matcher(tempStr);
    actName = "Intialization";
    } else {
    m = requestMessage.matcher(tempStr);
    String time = "";
    if(m.find()) {
    reqMatched = true;
    for (int i=1; i<=m.groupCount(); i++) {
    String groupStr = m.group(i);
    if(i == 1) {
    time = groupStr;
    } else if(i == 2) {
    actName = groupStr;
    } else if(!initReq){
    m = requestMessage1.matcher(tempStr);
    if(m.find()) {
    reqMatched = true;
    for (int i=1; i<=m.groupCount(); i++) {
    String groupStr = m.group(i);
    if(i == 1) {
    time = groupStr;
    } else if(i == 2) {
    actName = groupStr;
    if(time.length() > 0 ) {
    try{
    requestTime = sdf.parse(time).getTime();
    }catch(Exception ex){}
    System.out.println("Request,"+actName+","+time+",,,,"+dcf.format(((double)time.length()/1024.0))+"K");
                                  //bw.write("Request,"+actName+","+time+",,,,"+dcf.format(((double)time.length()/1024.0))+"K");
                                  String reqDataSize = dcf.format(((double)time.length()/1024.0))+"K" ;
                                  rowReq = sheet.createRow((short)counter);
                                       rowReq.createCell((short)0).setCellType(HSSFCell.CELL_TYPE_STRING);
                                       rowReq.createCell((short)0).setCellValue("Request");
                                       rowReq.createCell((short)1).setCellType(HSSFCell.CELL_TYPE_STRING);
                                       rowReq.createCell((short)1).setCellValue(actName);
                                       rowReq.createCell((short)2).setCellType(HSSFCell.CELL_TYPE_STRING);
                                       rowReq.createCell((short)2).setCellValue(time);
                                       rowReq.createCell((short)3).setCellType(HSSFCell.CELL_TYPE_STRING);
                                       rowReq.createCell((short)3).setCellValue("");
                                       rowReq.createCell((short)4).setCellType(HSSFCell.CELL_TYPE_STRING);
                                       rowReq.createCell((short)4).setCellValue("");
                                       rowReq.createCell((short)5).setCellType(HSSFCell.CELL_TYPE_STRING);
                                       rowReq.createCell((short)5).setCellValue("");
                                       rowReq.createCell((short)6).setCellType(HSSFCell.CELL_TYPE_STRING);
                                       rowReq.createCell((short)6).setCellValue(reqDataSize);
                                       counter = counter +1;
                                       System.out.println("counter is "+counter);
                             Matcher l = sentMessage.matcher(tempStr);
                             Matcher k = rcvdMessage.matcher(tempStr);
                   if(l.find()) {
                                            for (int i=1; i<=l.groupCount(); i++) {
         String groupStr2 = l.group(i);
    try{
    sentTime = sdf.parse(groupStr2).getTime();
    }catch(Exception ex){}
                        if(k.find())
                                                 for(int j=1;j<=k.groupCount(); j++) {
                                                 String groupStr1 = k.group(j);
                                                 try{
    recdTime = sdf.parse(groupStr1).getTime();
    }catch(Exception ex){}
                                                 presentTime = (recdTime - sentTime);
                                                 hasTime = hasTime + presentTime;
                                                 hasCalls = hasCalls +1;
    if(!reqMatched) {
    if(initReq) {
    m=initResIDMessage.matcher(tempStr);
    } else {
    m=responseMessage.matcher(tempStr);
    if(m.find()) {
    for (int i=1; i<=m.groupCount(); i++) {
    String groupStr = m.group(i);
    try{
    responseTime = sdf.parse(groupStr).getTime();
    }catch(Exception ex){}
                                                 String resDataSize = dcf.format(((double)tempStr.length()/1024.0))+"K" ;
                                                 rowRes = sheet.createRow((short)(counter));
                                                 rowRes.createCell((short)0).setCellType(HSSFCell.CELL_TYPE_STRING);
                                                 rowRes.createCell((short)0).setCellValue("Response");
                                                 rowRes.createCell((short)1).setCellType(HSSFCell.CELL_TYPE_STRING);
                                                 rowRes.createCell((short)1).setCellValue(actName);
                                                 rowRes.createCell((short)2).setCellType(HSSFCell.CELL_TYPE_STRING);
                                                 rowRes.createCell((short)2).setCellValue(groupStr);
                                                 rowRes.createCell((short)3).setCellType(HSSFCell.CELL_TYPE_NUMERIC);
                                                 rowRes.createCell((short)3).setCellValue((responseTime - requestTime));
                                                 rowRes.createCell((short)4).setCellType(HSSFCell.CELL_TYPE_NUMERIC);
                                                 rowRes.createCell((short)4).setCellValue(hasTime);
                                                 rowRes.createCell((short)5).setCellType(HSSFCell.CELL_TYPE_NUMERIC);
                                                 rowRes.createCell((short)5).setCellValue(hasCalls);
                                                 rowRes.createCell((short)6).setCellType(HSSFCell.CELL_TYPE_STRING);
                                                 rowRes.createCell((short)6).setCellValue(resDataSize);
                                                 hasTime = 0;
                                                 hasCalls = 0;
                                                 counter = counter + 1 ;
    sBuf.setLength(0);
    readed = false;
              wb.write(fileOut);
              } // End of for (int fileNo = 0; fileNo < children.length; fileNo++ )
    }     //End of else
              fileOut.close();
    } //End of public static void main
    } // End of Class

    First of all, use [code]-tags to make your code readable, please.
    I didn't do a complete inspection of your code (because it's too much and unreadable as it is) and I don't know POI, but creating a new HSSFWorkbook for each input file sounds fishy to me ... try re-using the workbook and just creating a new sheet in each iteration.

Maybe you are looking for

  • Error C1189: #error : ERROR: You must use a GNU Compiler.

    Hi everyone! I have just ran into an error in which I don't know how to resolve. I'm trying to compile some code I have but it gives me the following : error C1189: #error :  ERROR: You must use a GNU Compiler. Before receiving this error I had recei

  • How can i find out what the modification history is of  folder

    What I mean is that I had a folder deleted out of another folder and I'm trying to find out when this might have happened and how. I'm pretty certain that it's not a hidden script or macro or virus or some other malicious means. I figure it's just an

  • Is it j2ee.jar and jdk1.5.0.jar same

    when i search for j2ee.jar in google it is showing jdk1.5 but link is j2ee.jar download. is it same.in my tutorial they are saying download j2ee.jar if it differ ples send me link for download.

  • Web content overlay - always "on top"?

    Hi In my Indesign DPS doc, I have a top later with content and a second bottom layer with some html 5 animation showing within a web content overlay box. Everything previews well, except the overlay content always seems to be "on top".  guess this ma

  • Forte and windows98???

    Hi Forte Experts Can we use forte with windows98, and if so: which versions? limitations? problems? The reason for asking such a dumb question is, that we just installed a brand new 'super-specifications' pc with windows98 and now we have userwindows