Reading mulitple files

Hi all,
Im doing a program in which i have to read files continuously.I have all the file names in a string array.Here is my code
String[] ar=new String[5];
ar[0]="first.txt";
a[4] ="fifth.txt"
int len=ar.length;
for(int i =0;i<len;i++)
br = new BufferedReader(new FileReader(ar)
ss = new String[len];
     while((br.read(data)) > 1)
          ss[i]=new String(data);
     //System.out.println(ss[i]);
is it correct its printing only the first file without the first letter..
How to print all files data?

this is the data declaration:
  char[] data=new char[200];                          
               ss = new String[arr.size()];
              while((br.read(data)) > 1)
                   ss=new String(data);
i dont know the file size so simply gave char[200].am i have to use thread for multiple file reading? Aim of the program is after reading the first file .some processing then the second..etc                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Open/Create and write to mulitple files

    I am trying to do high speed data acquisition, and save data to file.  I will acquire a large number of data, so saving to just one file would result in my file blowing up in size.  Hence I would like to save my data to mulitple files.  I am trying to figure out how to open multiple files, then chose which file to write to.  My approach is to open/create multiple files and save their refnum in an array.  Then i would like to pick which file to write from this array.  I have attached my VI, whatever I have so far.  I seem to get errors like, "Duplicate path" or " An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @."  How would I get started with this problem?
    Solved!
    Go to Solution.
    Attachments:
    Create & Save to Mulitples Files.vi ‏24 KB

    Figured it out...
    sorry for the trouble!

  • Can no longer read plist files

    I've got a script that iterates through a list of hostnames, connects to each host, looks for the existence of a list of applications, and if they exist reads their Info.plist for the version.  This worked seamlessly until a couple of days ago.  The only change I can think of is having changed my username on all of my Macs from <username> to <username>.sa to differentiate privileged accounts from unprivileged accounts.  Yes, this caused a number of issues, and I've hunted them down.  I can connect to every host with <username>.sa, perform actions with sudo, etc.  What I can't do any more is read plist files, even when logged in locally:
    quad:~ username.sa$ defaults read /Applications/Utilities/Adobe\ Flash\ Player\ Install\ Manager.app/Contents/Info.plist
    2014-06-26 15:03:59.588 defaults[49157:507]
    Domain /Applications/Utilities/Adobe Flash Player Install Manager.app/Contents/Info.plist does not exist
    quad:~ username.sa$ ls -l /Applications/Utilities/Adobe\ Flash\ Player\ Install\ Manager.app/Contents/Info.plist
    -rw-r--r--  1 root  wheel  1344 May 28 12:02 /Applications/Utilities/Adobe Flash Player Install Manager.app/Contents/Info.plist
    quad:~ username.sa$ cat /Applications/Utilities/Adobe\ Flash\ Player\ Install\ Manager.app/Contents/Info.plist
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
      <key>BuildMachineOSBuild</key>
      <string>12E55</string>
      <key>CFBundleDevelopmentRegion</key>
      <string>English</string>
      <key>CFBundleExecutable</key>
      <string>Adobe Flash Player Install Manager</string>
      <key>CFBundleIconFile</key>
      <string>FlashPlayerInstaller.icns</string>
      <key>CFBundleIdentifier</key>
      <string>com.adobe.flashplayer.installmanager</string>
      <key>CFBundleInfoDictionaryVersion</key>
      <string>6.0</string>
      <key>CFBundleName</key>
      <string>Adobe Flash Player Install Manager</string>
      <key>CFBundlePackageType</key>
      <string>APPL</string>
      <key>CFBundleSignature</key>
      <string>????</string>
      <key>CFBundleVersion</key>
      <string>14.0.0.125</string>
      <key>DTCompiler</key>
      <string>com.apple.compilers.llvm.clang.1_0</string>
      <key>DTPlatformBuild</key>
      <string>4H1503</string>
      <key>DTPlatformVersion</key>
      <string>GM</string>
      <key>DTSDKBuild</key>
      <string>10K549</string>
      <key>DTSDKName</key>
      <string>macosx10.6</string>
      <key>DTXcode</key>
      <string>0463</string>
      <key>DTXcodeBuild</key>
      <string>4H1503</string>
      <key>NSMainNibFile</key>
      <string>FPIMMain</string>
      <key>NSPrincipalClass</key>
      <string>NSApplication</string>
    </dict>
    </plist>
    The file is there.  It is readable.  I can read it... just not with the 'defaults' command.  This is with all plists on all of my Macs.

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the startup volume is a Fusion Drive or a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of the test.

  • Error: Unable to read footer file

    Hoping someone out there can help me. I get this error on
    everypage in my site and have no idea how to stop it.
    Error: Unable to read footer file
    The error does not show up when I preview inside dreamweaver
    but only rears its ugly head after I post the site up on the
    internet. I have searched for hours through the Dreamweaver menus
    and can not find these elusive footers and have no idea where they
    are coming from or what footer file it is trying to read.. Please
    help. This probably has a simple solution and I am just not able to
    understand it. Thank you.

    sdrouillard wrote:
    > This probably has a simple solution and I am just not
    able to understand
    > it.
    Possibly, but without a URL we can't comment. Post it, and
    we'll see.
    At a guess, sounds like an include file is missing. Are you
    on some sort of
    free hosting plan where the host puts some adverts in the
    footer? If that
    file is removed from your site directory you might get the
    error you've
    mentioned (at least, that was the case on the only other time
    I've seen this
    error)
    Regards,
    Pete.
    Peter Connolly
    http://www.acutecomputing.co.uk
    Derby
    UK
    Skype ID: acutecomputing

  • Error reading excel file using POI.

    Hi ,
    I am having some problem when reading the excel file.
    While reading excel file I am getting error-java.io.IOException: Unable to read entire block; 4 bytes read; expected 512 bytes.
    part of my code:-
    InputStream stream = objFormFile.getInputStream();
    POIFSFileSystem fs = new POIFSFileSystem(stream);//getting above error here.
    HSSFWorkbook wb = new HSSFWorkbook(fs);
    Case 1:
    I download the file on the system ,save it ,and then directly upload it to the system ,I get the above error .
    Case 2:
    It works fine if I download the excel and manually open and save it and then upload it .
    I am using JDK1.4.1 and poi-2.5.1-final-20040804.jar.
    Can any one please help me out for the above problem?
    Edited by: hruday on Jul 31, 2008 3:20 AM

    Instead of using POIFSFileSystem, try to directly create the HSSFWorkbook
    InputStream stream = objFormFile.getInputStream();
    //POIFSFileSystem fs = new POIFSFileSystem( stream );//getting above error here.
    HSSFWorkbook wb = new HSSFWorkbook( stream );

  • Error reading Remote file when the connection is slow

    I have a program that reads a file from a remote server. The file is an xml file.
    This uses URL inputstream.
    This works just fine but when the xml that it reads grow in size, the content of the file is not completely sent to the variable string.
    I have come to a conclusion that slow connection to the server could somehow cause this. The error is intermittent. Sometimes it works, sometimes it doesn't.
    I hope you guys could help me tune this code or if you have suggestions like other ways to read a remote file. Which will work even if the file grows bigger.
    Thanks
    public String readRemoteFile(String fName)
    try
    boolean bolContinue = true;
    URL tUrl = new URL(fName); //create a URL object with the server source file
    //Logger.log("Getting filesize : " + fName);
    InputStream is = tUrl.openStream();
    String strFileSize = "";
    StringBuffer sbXML = new StringBuffer();
    byte[] b1 = new byte[10];
                   int intBytesToDownload = 0;
    int i = is.read(b1);
    strFileSize = new String(b1, 0, i);
    //Logger.log(fName + " --- " + strFileSize);
    try
    intBytesToDownload = Integer.parseInt(strFileSize);
    catch (NumberFormatException nfe)
    Logger.log("Could not read the file : " + fName);
    return null;
    int bytesReadInTrip = intBytesToDownload;
    int bXMLLocation = 0;
    while (bytesReadInTrip > 0)
    bytesReadInTrip = 0;
    bolContinue = true;
    //System.out.println(strFileURLPath);
    tUrl = new URL(fName + "&fileOffset=" + bXMLLocation);
    //Logger.log("reading file1 : " + fName + "&fileOffset=" + bXMLLocation);
    is = tUrl.openStream(); //get Input stream of the server file.
    //continue download till continuation flag is set i.e. input stream
    // is available.
    while (bolContinue)
              byte[] bXML = new byte[intBytesToDownload];
    i = is.read(bXML);
    //Logger.log("i " + i);
    if (i > 0)
    bXMLLocation += i;
    bytesReadInTrip += i;
    String strTmpXML = new String(bXML,0,i);
         sbXML.append(strTmpXML);
    else
    bolContinue = false;
    is.close(); //close the input stream of the input file.
    //Logger.log("bytesReadInTrip : " + bytesReadInTrip);
    //Logger.log("Read file : "+ sbXML.toString());
    return sbXML.toString();
    catch (Exception e)
    Logger.log("Exception while reading the file : " + fName);
    return null;
    }

    well looks that ur run() method is being called more then one time (..)
    why dont u try file method exists() before writing it to ensure that it is not written previously

  • Error reading from file glibc-2.5-24.i686.rpm RHEL 5 Setup stuck at 80%

    Hi, I am installing Oracle 10g on RHEL 5 (Red Hat Enterprise Linux 5) machine I am facing two problems
    1) while installing the rpm packages the following package gave an error
    Error reading from file glibc-2.5-24.i686.rpm
    2) I still gave a try to runInstaller command the installer opened but was stuck at 80%
    I have 3 GB ram and 320GB hard drive I am not sure what to put in the swap memory and other settings i blindly followed instructions given here
    http://www.oracle-base.com/articles/10g/OracleDB10gR2InstallationOnRHEL5.php
    What could be the problem where do I find the error log if its created
    Please help me
    Thanks
    Edited by: 891355 on Nov 6, 2011 12:06 PM

    I found the installActions file in the installer folder and I think this could be the problem
    INFO: The 'shiphomeproperties.xml' file is missing from shiphome location '/home/oracle/Desktop/database/install/../stage/products.xml.' Add this file to the 'Disk1/stage' directory of the shiphome.
    though I am attaching the log file for more details do you think the installer is corrupt :(
    InstallActions log file ==> http://www.mediafire.com/?nh7mx7bxqht9ovu
    Edited by: 891355 on Nov 6, 2011 1:35 PM

  • Error reading wsdl file excepetion null

    Hi
    I am trying to invoke a proxy service (web service) wsdl from a bpel process. When i add a web service adapter, put url of external web service and save it, all my service end points defined in the BPEL process are becoming non editable. Binding of operation is changing from web service to HTTP binding for all end points. When I try to edit any partner link, Jdev throws an error " error reading wsdl file excepetion null " for local services. For external service, even though i am refering to a url on the server, it points to " C:\Oracle\Middleware\jdeveloper\jdev\bin\...\xxxx?WSDL" and throws same error " failed to read wsdl file(System could not find the path specified". I am just clueless as to why this is happening. Any help is much appreciated.

    Try the SOA Forum - SOA Suite

  • \\Error Reading Rules File when dimbuild with DLR

    Hi
    I am using Essbase 11.1.2.1.
    I create a DLR via the web console EAS (11.1.2.1 too) : a very simple one : dimbuild DLR, ";" as separator, 2 fields (parent and child)
    when i try do do a "Update Ouline..." with a very simple file (1 line : accounts;test) I have this error message "\\Error Reading Rules File"
    I don't know if it can help but if I create the same DLR on another 7.1 essbase serveur through this same wec eas console (11.1.2.1), I have no problem...
    another information, too : my 11.1.2.1 server has a //ESS_LOCALE English_UnitedStates.Latin1@Binary ESSLANG. My 7.1 server has a //ESS_LOCALE French_France.ISO-8859-15@Default ESSLANG. I really don't know if there is a link, or absolutely not.
    Thanks in advance for your help!
    Fanny

    unable to load essmsh.exe : the error message seems to indicate that it is a problem with a path in the environment variables.
    So if you say that the "Error Reading Rules File" is typically a path issue, all is probably linked!
    The admin will probably correct that tomorrow : I let you know if it solves the problem!
    Thanks!
    Fanny

  • Error reading product file driver files

    When attempting apply a large merge patch I receive the following error:
    Screening out files not valid for this installation...
    Determining valid on-site files...
    AutoPatch error:
    The following file is missing:
    /oracle/prodappl/pa/11.5.0/admin/driver/pasb038.drv
    AutoPatch error:
    Error reading product file driver files [complete; make tapes]
    AutoPatch error:
    Error determining valid on-site files
    Any ideas?
    I've tried using options=noprereq option, but that didn't help.

    - Try to restore the file from a backup you have Or just copy it from any other environment.
    - Make sure that you have included all pre-req patches in the merged file.
    I've tried using options=noprereq optionBy this you tell adpatch not to check for pre-req, use 'options=prereq' instead.

  • Error reading zip file in Java 6

    We have a bespoke installer program that fails, intermittently, in Java 6 on Windows. After installing some files, it then fails with a stack trace like this:
    java.util.zip.ZipException: error reading zip file
         at java.util.zip.ZipFile.read(Native Method)
         at java.util.zip.ZipFile.access$1200(ZipFile.java:29)
         at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:447)
         at java.util.zip.ZipFile$1.fill(ZipFile.java:230)
         at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:141)
         at java.io.FilterInputStream.read(FilterInputStream.java:90)
         at com.XXXX.trent.installer.Installer.writeStreamToFile(Unknown Source)
         at com.XXXX.trent.installer.Installer.installFile(Unknown Source)
         at com.XXXX.trent.installer.PatchFileInstaller.installFile(Unknown Source)
         at com.XXXX.trent.installer.PatchFileInstaller.installFiles(Unknown Source)
         at com.XXXX.trent.installer.UpgradeInstaller$TpfAction.run(Unknown Source)
         at com.XXXX.trent.installer.UpgradeInstaller.runActions(Unknown Source)
         at com.XXXX.trent.installer.UpgradeInstaller.install(Unknown Source)
         at com.XXXX.trent.installer.TrentInstall$SoftwareInstallStage.install(Unknown Source)
         at com.XXXX.trent.installer.TrentInstall$UpgradeInstallWorker.install(Unknown Source)
         at com.XXXX.trent.installer.PatchInstall$InstallWorker.construct(Unknown Source)
         at com.XXXX.trent.utils.SwingWorker$2.run(Unknown Source)
         at java.lang.Thread.run(Thread.java:619)The same code works in Java 5 on the same environments that it now fails in Java 6 (1.6.0_16).
    Any ideas?
    Thanks.

    gimbal2 wrote:
    it is not weird, it is a bug in the application. Don't let the upgrade from Java 5 to Java 6 make you believe otherwise.It's a singularly bad exception message though. I would have thought that something from java.util might be a bit more explicit about what the problem is.
    Winston

  • Error reading project file : no protocol

    I have followed the instructions exactly as in the j2ee tutiorial ,but, when I run asant , an error occurs:
    : Error reading project file : no protocol: ../../common/targets.xml
    Urgent!

    Could you please provide a bit more detail such as which sample you are using? Also are you using the latest version of the tutorial and have you configured your build.properties in the samples/common directory?

  • Error reading Maya file

    I was trying to import a camera into AE, but I encounted the error: AEGP Plugin MayaImport: Error reading Maya file. (5027::12)
    Here's how I did:
    Version of softwares:
    Maya 2014 and 2013
    After Effects CS6
    System:
    Windows 7 & Mac OS 10.6.8
    I exported Camera and locator from a maya(.mb) file and save it as a .ma file. I baked all keyables of the camera.
    Then I tried to import it into AE. and the error occured.
    I tried different versions of maya and different systems, as I mentioned above. But the results were the same.
    Does anybody know how to fix it? Or show me another way to import Maya's camera into AE?
    Thanks!

    Without seeing the actual Maya file nobody can say anything. Could simply need a manual editing of the file version info or some reformatting...
    Mylenium

  • Error reading/writing file "com.garageband.cs":`≤Ć». message

    Hey all! Don't know if anyone can help but I keep getting the message...
    " Error reading/writing file "com.garageband.cs":`≤Ć». " with a cancel button.
    If you click on it it does go away, but after a time playback starts skipping and stuff.
    Anyone help please?
    Thanks
    Righini

    first two things to try for “oddball” probs:
    http://www.bulletsandbones.com/GB/GBFAQ.html#oddballprobs
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • Error reading/writing file message when opening garageband and/or files

    I've been recently getting this message when I open garageband and files
    "Error reading/writing file\U201Ccom.apple.garageband.cs\U201D
    I've been in and repaired disk permissions and all that it says it is all fine, reinstall garageband and message still comes up, weird.
    not only is garageband being a nuisance, Mac OS X 10.6.2 is being a pain when shutting down telling me to restart the computer. This only happened since upgrading to 10.6. No one as yet knows this promble so I'm gonna have to ring apple and see what is going on here.
    and also my other problem is that mac doesn't seem as snappy anymore I noticed this before upgrading to 10.6 and made no difference when "cleanly" installing 10.6. I get a colour wheel popping up and i'm having to wait with simple tasks. iMac only 2 years old.

    i give up with this discussion forum no no one knows anything

Maybe you are looking for

  • Should I create a new iTunes account for a podcast?

    We are still in the process of getting our first podcast edited and ready to go, along with the website, podcast hosting, etc... But I was curious about when we are ready to submit the podcast to iTunes.... Should I ceate a new iTunes account, dedica

  • Security setting for Material Master

    Hi Experts, After creation or while creation of material master MM and PP group user should have access to MM and PP views for MM02/MM01. FI should have access to FI views and SD group should have access to SD views. And everybody should have access

  • Can i use an external dvd burner on my imac?

    My dvd drive is not working. Would i be able to buy & use an external burner?  I have a G5 using Snow leopard. thanks

  • Solid red light

    My HP Envy HD always had a solid blue light on the tower panel. Last night, the tower panel had a solid red light & monitor said no signal, check video connection, so hubby changed HDMI cable. Still didn't work, but somehow he did get it to work & mo

  • When I try to restore my iMac on Mavericks with Time Machine it stalls on the apple logo

    After trying to restore through time machine it hangs on the apple logo with the spinning disk below it. I have left it for 3 days nothing happens. So I just reinstalled Mavericks and it works but its seems broken. Most notable is iPhotos, when I ope