Read from a file and execute the statement

Hi
I have a .sql file that contains insert statements.
I would like to open the file, read a statement and execute it using a procedure.
Can sombody help me out?

> I have a .sql file that contains insert statements.
I would like to ...<snipped> ... execute it ...<snipped>...
Go to SQL*Plus and type in "start <your file name>" ?
If the goal is to insert those records, and using a procedure is less important.
Regards,
Rob.

Similar Messages

  • Read from .txt file and output the content as two arrays

    I am using the contoured move to control the x-y stage. The trajectory datas for x and y axis are generated using my interpolation program and it is stored in a .txt file as two columns. What I want to do is read .txt file and output the content of this file as two arrays. Is there anyone has any ideas? Thanks, the .txt file is attached.
    Attachments:
    R.75.txt ‏172 KB

    Hi Awen,
    This is quite easy to do, you can merely use the "read from spreadsheet file" function to get a 2D array (2 columns and n rows) and then use the index array function to get whatever row/colums you want..
    Hope the attached VI helps you
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"
    Attachments:
    read sprdsheet file.vi ‏27 KB

  • Reading from XML file and updating the table ????

    Hi
    I have package which reads the hier.XML file and does Update inserts into the 5 tables
    i have table called MAIN_tbl with the column cur_date.
    The package kicks if this cur_date is one day less than the hier.XML file DT.
    Currently i m manually checking this date's to make sure the Main_tbl cur_date is n sync with
    hier.XML file DT.
    for example :- hier.xml file DT is "20091020" then main_table cur_date should be 10/19/2009
    in order to kicks of the pakage.
    what i m looking to do ??
    compare the hier.xml DT with the main_table cur_date,
    if cur_date is -1(Preivous day) of hier.xml DT then run hier_pkg(Package)
    if not then update main_table cur_date to -1(previous day) of the hier.xml DATE
    Then later write the above logic to update the main_table in a procedure, and
    then call the package from the procedure.
    below are the top few lines of the hier.XML file which is relevant to the one which we are trying to do
    <?xml version = '1.0'?>
    <HIER_POSTING num ="111" HIER_TYP="CD" DT="20091020" Global="Y">
    FYI : The hier.XML file is located in UNIX space.
    How do i accomplish this. any idea ????
    Thank you so much in advance. For giving a thought on this problem!!!

    Any thought on this guys ???
    Thanks!!

  • How do I read from a file and store the information in an array?

    Here is my problem:
    I am going to have to use a bufferedReader to read a file containing information on 10 vehicles. And after I read that file I want to store the info in Vehicle [] V.
    Where should I start?
    Thanks
    Steve

    Thank you for the quick response.
    As of right now our code is the same. Now I have to "parse" the information. What exactly do you mean?
    My code is as follows:
    while((str = br.readLine()) != null)
    String[] tokenArray = str.split(" ");
    for(int i = 0; i < tokenArray.length; i++)
    System.out.print(" Token: " + tokenArray);
    System.out.println("\n");
    Is that what you mean by parsing?
    I am not quite sure what e slpit(" ") is doing. Is there a better way?
    And just to make sure I am understanding my own code, I am storing the information from the br in tokenArray. Followed by a series of print statements which output the info.Correct?
    Thanks again,
    Steve                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to  read from excel file and write it using implicit jsp out object

    our code is as below:Please give us proper solution.
    we are reading from Excel file and writing in dynamicaly generated Excel file.it is writing but not as original excel sheet.we are using response.setContentType and response.setHeader for generating pop up for saveing the original file in to dynamically generated Excel file.
    <%@ page contentType="application/vnd.ms-excel" %>
    <%     
         //String dLoadFile = (String)request.getParameter("jspname1");
         String dLoadFile = "c:/purge_trns_nav.xls" ;
         File f = new File(dLoadFile);
         //set the content type(can be excel/word/powerpoint etc..)
         response.setContentType ("application/msexcel");
         //get the file name
         String name = f.getName().substring(f.getName().lastIndexOf("/") + 1,f.getName().length());
         //set the header and also the Name by which user will be prompted to save
         response.setHeader ("Content-Disposition", "attachment;     filename="+name);
         //OPen an input stream to the file and post the file contents thru the
         //servlet output stream to the client m/c
              FileInputStream in = new FileInputStream(f);
              //ServletOutputStream outs = response.getOutputStream();
              int bit = 10;
              int i = 0;
              try {
                        while (bit >= 0) {
                        bit = in.read();
                        out.write(bit) ;
    } catch (IOException ioe) { ioe.printStackTrace(System.out); }
              out.flush();
    out.close();
    in.close();     
    %>

    If you want to copy files as fast as possible, without processing them (as the DOS "copy" or the Unix "cp" command), you can try the java.nio.channels package.
    import java.nio.*;
    import java.nio.channels.*;
    import java.io.*;
    import java.util.*;
    import java.text.*;
    class Kopy {
         * @param args [0] = source filename
         *        args [1] = destination filename
        public static void main(String[] args) throws Exception {
            if (args.length != 2) {
                System.err.println ("Syntax: java -cp . Kopy source destination");
                System.exit(1);
            File in = new File(args[0]);
            long fileLength = in.length();
            long t = System.currentTimeMillis();
            FileInputStream fis = new FileInputStream (in);
            FileOutputStream fos = new FileOutputStream (args[1]);
            FileChannel fci = fis.getChannel();
            FileChannel fco = fos.getChannel();
            fco.transferFrom(fci, 0, fileLength);
            fis.close();
            fos.close();
            t = System.currentTimeMillis() - t;
            NumberFormat nf = new DecimalFormat("#,##0.00");
            System.out.print (nf.format(fileLength/1024.0) + "kB copied");
            if (t > 0) {
                System.out.println (" in " + t + "ms: " + nf.format(fileLength / 1.024 / t) + " kB/s");
    }

  • How i can to create a vi, which read from configuration file and i could modify this indicator and save the config data??

    Hi guys,
    I have in my application a subvi which i use to save the configuration of application. I create one file with the last saved configuration, and i would like to open this values and that i could to modify this indicator value, but i cant since to modify i need 'numeric control' and to read the data from file i need 'numeric indicator '...
    I thought, use a numeric control and use the values from file to the default values, but i didnt get to find the property node to adjust it. is it possible? or any different way to get it....??
    Also, i attached the capture file.. i would like the program DOESNT SHOW the question of
    replace the file!!. i would like directly replace the file when i push save.
    Thanks, i attached the vi.
    Attachments:
    options.vi ‏43 KB
    config.cnf ‏1 KB
    capture.GIF ‏43 KB

    Hi Dennis,
    Your 'write to sreadshhet mod' suprime the dialog of replace file or not!, i want when i push save, it show the dialog input name of file and show the default sim000 but when i push this sim000 and this file already exist, then show the dialog to replace or not, if i replace Ok not problem, but when i push cancel replace it shows error eof!!!.
    Your file, only remove this dialog and only replace the file directly.
    i put the capture, when i choose the file to save and the program say to me this file exist and it give me the option of replace or not,i want when i push cancel replace it continues running without get error.
    is it possible?.
    Thanks.
    Regards, Fonsi.
    Attachments:
    capture.GIF ‏71 KB
    example.vi ‏40 KB

  • "Read from Binary File" and efficiency

    For the first time I have tried using Read from Binary File on sizable data files, and I'm seeing some real performance problems. To prevent possible data loss, I write data as I receive them from DAQ, 10 times per second. What I write is a 2-D array of double, 1000 data points x 2-4 channels. When reading in the file, I wish I could read it as a 3-D array, all at once. That doesn't seem supported, so I repeatedly do reads of 2-D array, and use a shift register with Build Array to assemble the 3-D array that I really need. But it's incredibly slow! It seems that I can only read a few hundred of these 2-D items per second.
    It also occurred to me that the Build Array being used in a shift register to keep adding on to the array, could be a quadratic-time operation depending on how it is implemented. Continually and repeatedly allocating bigger and bigger chunks of memory, and copying the growing array at every step.
    So I'm looking for suggestions on how to efficiently store, efficiently read, and efficiently reassemble my data into the 3-D array that I need. Perhaps I could simplify life if I had  "write raw data" and "read raw data" operations that write and read only the numbers and no metadata.then I could write the file and read it back in any size chunks I please -- and read it with other programs besides. But I don't see them in the menus.
    Suggestions?
    Ken
    Solved!
    Go to Solution.

    I quote the detailed help from Read from Binary File:
    data type sets the type of data the function uses to read from
    the binary file. The function interprets the data starting at the current file
    position to be count instances of data type.
    If the type is an array, string, or cluster containing an array or string, the
    function assumes that each instance of that data type contains size information.
    If an instance does not include size information, the function misinterprets the
    data. If LabVIEW determines that the data does not match the type, it sets data
    to the default for the specified type and returns an error.
    So I see how I could write data without any array metadata by turning off "prepend array or string size information", but I don't see any way to read it back in such bare form. If I did, I'd have to tell it how long an array to read, and I don't see where to do that. If I could overcome this, I could indeed read in much larger chunks.
    I'll try the auto-indexing tunnel anyway. I didn't tell you the whole truth, the 3-D array is actually further sliced up based on metadata that I carry, and ends up as a 4-D array of "runs". But I can do that after the fact instead of trying to do it with shift registers as I'm reading.
    Thanks,
    Ken

  • Issue : Read a text file and print the same

    Hi, My requirement is to read a text file and print it the same way.
    import java.io.BufferedReader;
    import java.io.FileReader;
    public class CatFile {
    public static void main(String[] args) throws Exception
         FileReader file = new FileReader("D:/Test/Allfiles.txt");
         BufferedReader reader = new BufferedReader(file);
         String text = "";
         String line = reader.readLine();
         while (line != null)
              text += line;
              line = reader.readLine();
         System.out.println(text);
    The text file i used contains
    A
    B
    C
    but my output is ABC.
    What change should be made to print it the same way in the txt file ?

    Hi EJP,
    I modified the code based on your suggestion and now its working as expected. Thanks
    Modified code :
    import java.io.BufferedReader;
    import java.io.FileReader;
    public class CatFile {
    public static void main(String[] args) throws Exception
         FileReader file = new FileReader("D:/Test/Allfiles.txt");
         BufferedReader reader = new BufferedReader(file);
         String text = "";
         String line = reader.readLine();
         while (line != null)
              System.out.println(line);
              line = reader.readLine();
              text += line;
    }

  • Using servlets to read from text file and insert data

    Hi,
    Can I use a servlet to read from a space delimited text file on the client computer and use that data to insert into a table in my database? I want to make it easy for my users to upload their data without having to have them use SQL*Loader. If so can someone give me a hint as how to get started? I appreciate it.
    Thanks,
    Colby

    Create a page for the user to upload the file to your webserver and send a message (containing the file location) to a server app that will open the file, parse it, and insert it into your database. Make sure you secure the page.
    or
    Have the user paste the file into a simple web form that submits to a servlet that parses the data and inserts it into your db.

  • Urgent Help:read from text file and write to table

    Hi,
    I'm a super beginner looking for a vi to read this data from a text file and insert it into a table:
       #19
    Date: 05-01-2015
    ID= 12345678
    Sample_Rate= 01:00:00
    Total_Records= 2
    Unit: F
       1 03-23-2015 10:45:46   70.1   3.6
       2 03-23-2015 11:45:46   67.7   2.7
    Output table
    #     date                 time                 x          y        Sample rate    Total Records
    1          03-23-2015     10:45:46        76.8     2.8      01:00:00           2
    2          03-23-2015     10:45:46        48.7     2.1      01:00:00           2
    Thanks for your help in advance.
    Attachments:
    sample.txt ‏1 KB

    jcarmody wrote:
    Will there always be the same number of rows of noise header information?
    Show us how you've read the data and what you've tried to do to parse it.  Once you've got the last rows, you can loop over them using Spreadsheet String to Array (after cleaning up a few messy spaces).
    Jim,
    I didn't know you're that active on here.
    Yes, There will always be the same number of noise header information.
    I'll show you in person
    Regards,

  • Read from text file and seperate column

    hello,
    I have a problem reading my text file. This text file is downloaded from weather link. All data will be changed upon the selection of user. my problem is I can read the data column by column but i cannot retrive the right column header for each data. I also attached the test file. Can somebody help me? Thanks in advance..
    Attachments:
    download.txt ‏8 KB
    read text file.JPG ‏11 KB
    read data.JPG ‏43 KB

    Hi
    Sorry, I missed that one. The file formatting is strange though. It uses spaces to separate columns but also within columns. I attached a modified VI that tries to take care of that, but it fails at the columns "Solar Energy" and "Hi Solar Rad.". This is very difficult to read programmatically as there's one space each between "Solar", "Hi", and "Solar" again. So how do we distinguish between column separator and space within column?
    Is download.txt the original file? Or was it probably modified by an editor that would replace tabs by space characters?
    Attachments:
    test-mod-2.vi ‏11 KB

  • Scenario to read from txt-file and create a sales order

    Hi,
    i have started creating a scenario to read from an txt-file and to create a sales order.
    When i activate my scenario, i get the following message :
        no scenario step (vBIU) associated for this step for the incoming system (SysId)
    When i look into the detailed xml-file i see that all the records are read from the file, but there is no next step to be treated.
    Has somebody any idea how this come ?
    -<Msg MessageLog="true" msglogexcl="false" logmsg="0009" recording="true" BeginTimeStamp="20111202095144" MessageId="11120209514499820828C0A801674F24" xmlns="urn:com.sap.b1i.vplatform:entity">-<Header><msglog b1ifactive="true" always="false" step="Default message log"/>-<Resumption><starter ipo="/vP.0010000138.in_FEAN/com.sap.b1i.vplatform.runtime/INB_FI_EXST_ASYN_NAM/INB_FI_EXST_ASYN_NAM.ipo/proc"/></Resumption><IPO tid="11120205535899820808C0A801678C54" Id="INB_FI_EXST_ASYN_NAM"/><Sender Id="0010000138"/><Inbound file="ORDERS_TEST" ext="csv" path="C:\TEMP\In" pltype="txt" wrap="" deli=";"/></Header>-<Body><Payload Type="File exist" Role="T"/>-<Payload Role="S">-<io xmlns="urn:com.sap.b1i.bizprocessor:bizatoms" pltype="txt">
    -<row>
    <col>OH</col>
    <col>0000087077</col>
    <col>201110041205</col>
    <col>220</col>
    <col>9</col>
    <col>201110191702</col>
    <col>8710624300012</col>
    <col>8714252008609</col>
    <col>8710624300012</col>
    <col>8714252008609</col>
    <col>8710624300012</col>
    <col>N</col>
    <col>N</col>
    <col>N</col>
    </row>
    -<row>
    <col>OL</col>
    <col>1</col>
    <col>8711715844378</col>
    <col>20</col>
    </row>-<row>
    <col>OL</col>
    <col>2</col>
    <col>8711715844392</col>
    <col>60</col>
    </rowrow>
    <col>OL</col>
    <col>16</col>
    <col>8710251791092</col>
    <col>280</col>
    </row>
    </io>
    </Payload>
    </Body>
    </Msg>
    This is my final atom :
    <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:b1e="urn:com.sap.b1i.sim:b1event" xmlns:b1ie="urn:com.sap.b1i.sim:b1ievent" xmlns:bfa="urn:com.sap.b1i.bizprocessor:bizatoms" xmlns:jdbc="urn:com.sap.b1i.adapter:jdbcadapter" xmlns:rfc="urn:sap-com:document:sap:rfc:functions" xmlns:sim="urn:com.sap.b1i.sim:entity" xmlns:utils2="com.sap.b1i.bpc_tools.Utilities" xmlns:vpf="urn:com.sap.b1i.vplatform:entity" xmlns:xci="urn:com.sap.b1i.xcellerator:intdoc" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" bfa:force="" vpf:force="" jdbc:force="" rfc:force="" b1ie:force="" b1e:force="" xci:force="" sim:force="" utils2:force=""><xsl:output method="xml" encoding="UTF-8" indent="yes"></xsl:output><xsl:param name="atom"></xsl:param><xsl:param name="sessionid"></xsl:param><xsl:variable name="msg" select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role=&apos;S&apos;]"></xsl:variable><xsl:variable name="vpSender" select="/vpf:Msg/vpf:Header/vpf:Sender/@Id"></xsl:variable><xsl:variable name="vpObject" select="/vpf:Msg/vpf:Header/vpf:Sender/@ObjId"></xsl:variable><xsl:variable name="vpReceiver" select="/vpf:Msg/vpf:Header/vpf:ReceiverList/vpf:Receiver[./@handover=&apos;P&apos;]/@Id"></xsl:variable><xsl:template match="/">
    <Msg xmlns="urn:com.sap.b1i.vplatform:entity">
    <xsl:copy-of select="/vpf:Msg/@*"></xsl:copy-of>
    <xsl:copy-of select="/vpf:Msg/vpf:Header"></xsl:copy-of>
    <Body>
    <xsl:copy-of select="/vpf:Msg/vpf:Body/*"></xsl:copy-of>
    <Payload Role="R" id="{$atom}">
    <xsl:call-template name="transform"></xsl:call-template>
    </Payload>
    </Body>
    </Msg>
    </xsl:template><xsl:template name="transform">
    <FinalAtomResult xmlns="">
    <BOM>
    <BO>
    <AdmInfo>
    <Object>17</Object>
    <Version>2</Version>
    </AdmInfo>
         <Documents>
         <row>
         <DocDate>
              <xsl:copy-of select="$msg/io/row[0]/col[2]/text()"></xsl:copy-of>
         </DocDate>
         <DocDueDate>
              <xsl:copy-of select="$msg/io/row[0]/col[5]/text()"></xsl:copy-of>
         </DocDueDate>
         <CardCode>KD10251</CardCode>
         <NumAtCard>
              <xsl:copy-of select="$msg/io/row[0]/col[1]/text()"></xsl:copy-of>
         </NumAtCard>
         <U_PMX_JD_COMP>32</U_PMX_JD_COMP>
         </row>
                          </Documents>
         <Document_Lines>
         <xsl:for-each select="$msg/io/row">
         <row>
         <BarCode>
              <xsl:copy-of select="$msg/io/row[*]/col[2]/text()"></xsl:copy-of>
         </BarCode>
         <Quantity>
              <xsl:copy-of select="$msg/io/row[*]/col[3]/text()"></xsl:copy-of>
         </Quantity>
         </row>
         </xsl:for-each>
         </Document_Lines>

    Mike,
    you were right, you may not specify the extension of a file.
    Another thing i detected is that the loop of my data start with the index 1 instead of 0 !!!
    In this scenario, i have to read all the lines of the file and each time i should do a SQL-query,
    so that i can use the result to build my sales document.
    Do you know if it this is possible or have you any idea how to do this ?
    thx,
    Mario

  • Read from csv file and plot particular columns

    Hello,
    I`m a new user of Labview and here it comes...my first major problem.
    Maybe this has been discussed before. I’ve made a search to solve my problem first but I couldn`t find anything helpful so I `ve decided to post a new message.
    So here is my problem:
    I`m working in a small semiconductor lab where different types of nitrides are grown using proprietary reactor. The goal is to read the collected csv files from each growth in Labview and plot the acquired data in appropriate graphs.
    I have a bunch of csv files and I have to make a Labview program to read them.
    The first part of my project I`ve decided to be displaying the csv file (growth log file) under labview (which I think works fine).
    The second one is to be able to plot particular columns from the recipe in graphs in Labview (that one actually gives me a lot of trouble):
    1. Timestamp vs Temperature /columns B and D/
    2. Timestamp vs Gas flow /columns L to S/
    3. Timestamp vs Pressure /columns E,K,T,U,V/
    I`ve got one more problem. How can I convert the Timestamp shown in csv file to human readable date in labview? This actually is a big problem, because the timestamp is my x axis and I want to know at what time a particular process took place and I also want to be able to see the converted timestamp when displaying csv file at first. I`ve read a lot about time stamping in excel and timestamp in labview but I`m still confused how to convert it in my case.
    I don`t have problems displaying csv file under Labview. My problems are with the timestamp and the graphs.
    Sorry for my awful English.  I hope you can understand my problems since English is not my mother language. 
    Please find the attached files.
    If you have any ideas or suggestions I`ll be more than happy to discuss them.
    Thank you in advance.
    Have a nice day! 
    Attachments:
    growth log.csv ‏298 KB
    Read from growth log.vi ‏33 KB

    Hello again,
    I`m having problems with converting the first column in the attached above file Growth Log.csv.
    I have a code converting xl timestamp to time and using Index Array traying to grab a particular column out of it but the attached file is written in strings so I guess I have to redo it in array but I don`t know how.Would you help me with this one?
    Attachments:
    Xl Timestamp to Time.vi ‏21 KB

  • Need a VB-Script that read a txt-file and only the lines that are new since last time

    Hi,
    I need help to write a VB script that read all new lines since the last time.
    For example:  The script reads the textfile at specific time, then 10 minutes later the script read the file again, and it should now only read the lines that are new since last time. Anyone that has such a script in your scriptingbox?
    cheers!
    DocHo
    Doc

    Based on the excellent idea by Pegasus, where is a VBScript solution. I use a separate file to save the last line count read from the file, then each time the file is read I update the line count. Only lines after the last count are output by the program:
    Option Explicit
    Dim strFile, objFSO, objFile, strCountFile, objCountFile, strLine, lngCount, lngLine
    Const ForReading = 1
    Const ForWriting = 2
    Const OpenAsASCII = 0
    Const CreateIfNotExist = True
    ' Specify input file to be read.
    strFile = "c:\Scripts\Example.log"
    ' Specify file with most recent line count.
    strCountFile = "c:\Scripts\Count.txt"
    ' Open the input file for reading.
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.OpenTextFile(strFile, ForReading)
    ' Check if the line count file exists.
    If (objFSO.FileExists(strCountFile) = False) Then
        ' Initial count is 0, so all lines are read.
        lngCount = 0
    Else
        ' Open the line count file.
        Set objCountFile = objFSO.OpenTextFile(strCountFile, ForReading)
        ' Read the most recent line count.
        Do Until objCountFile.AtEndOfStream
            lngCount = CLng(objCountFile.ReadLine)
        Loop
    End If
    ' Read the input file.
    lngLine = 0
    Do Until objFile.AtEndOfStream
        ' Count lines.
        lngLine = lngLine + 1
        strLine = objFile.ReadLine
        If (lngLine >= lngCount) Then
            ' Output the line.
            Wscript.Echo strLine
        End If
    Loop
    ' Close all files.
    objFile.Close
    If (lngCount > 0) Then
        objCountFile.Close
    End If
    ' Ignore last line of the file if it is blank.
    If (strLine = "") Then
        lngLine = lngLine - 1
    End If
    ' Save the new line count.
    Set objCountFile = objFSO.OpenTextFile(strCountFile, _
        ForWriting, CreateIfNotExist, OpenAsASCII)
    objCountFile.WriteLine CStr(lngLine + 1)
    objCountFile.Close
    Richard Mueller - MVP Directory Services

  • How to Read from two file and write to another file --Please help !!

    Hi all,
    Please suggest me where i'm goin goin wrng.
    I have 2 flat files. one of them is the main file(Ann.dat) has a about 150,000 lines (each line has unique ID from 00001 to 45000) of data and the the other(Miss.dat) has a just a list of IDs that are no longer in use & have to be deleted from the first file(NewAnn.dat). (Note that Ann.dat is a tab delimitted file and Miss.dat is just a list of all invalid IDs)
    Below is my code. It doesn't do what I'm supposed to. Please suggest me or help me with a code to do it. What I'm trying to do is read each of the lines from the 2 files compare the ID in ann.dat with all the IDs in Miss.dat & if it doesn't match with the ID in Miss.dat write the whole line to NewAnn.dat. And do the rest with all the lines in Ann.dat.
    It could be a real dumb question. since i'm not a software professional, I consider myself to be newbie to programming. I desperately need your help.
    import java.io.*;
    import java.util.*;
    public class anntemp{
         public static void main(String[] args)
              String keyAnn ="";
              String keyMis="";
              String recAnn =null;
              String recMis =null;
              try{               
              FileReader fr=new FileReader("C:\\Tom\\Ann.dat");
              BufferedReader br=new BufferedReader(fr);
              int couter=0;
              while ((recAnn = br.readLine())!=null)
                   couter++;
                   keyAnn = recAnn.substring(0, recAnn.indexOf("\t"));
              FileReader fr1=new FileReader("C:\\Tom\\Miss.dat");
              BufferedReader br1=new BufferedReader(fr1);
              while((recMis = br1.readLine())!=null){
              keyMis = recMis.substring(0, recMis.indexOf("\t"));
                   if(keyAnn.equals(keyMis)){
         FileWriter fw=new FileWriter("C:\\Tom\\NewAnn.dat",true);
         BufferedWriter bw=new BufferedWriter(fw);
         PrintWriter pw=new PrintWriter(bw);
         StringBuffer writeValue = new StringBuffer();
         writeValue.append(recAnn);
                                                 pw.println(writeValue.toString());
         pw.flush();
              }catch (Exception expe){
                   System.out.println("In Exception ");
                   expe.printStackTrace();
    Thank you all in advance,
    br

    I think you need to close the files when you are done in the inner loop. Plus I think you'll be overwritting the file in the inner loop if more than one match. It might be easier to read the unused id file into a map at the start, and then loop up the id's from the master file in the map. You can put the unused id's in as the keys, and a Boolean.TRUE as the value (value won't matter). Then just check if the map contains the key for the id read from the master file. That should cut down on disk activity. This assumes the unused id file is smallish.

Maybe you are looking for

  • Can I use the Hot keys in my app?

    I want to trigger a action when home button is pressed continously or four times? Or can I use volume buttons or power button to trigger a action? when the application in the foreground.Is it possible...If so can you help me with some sample source c

  • IPod not recognized by computer and other problems

    I have a 3rd generation iPod. When I try to charge it, a folder comes up with an exclamation mark in it. I tried to follow some of the steps on the site, but it didn't seem to work. Also, when I try to connect the iPod to the computer, it just does n

  • Looking for 16GB RAM That is Compatible with Late-2011 17" Macbook Pro

    Hi guys, I am looking to upgrade the RAM and Hard Drive in my late-2011 17" Macbook Pro. I've already found the hard drive I want to use, but I don't know as much about RAM, and I'm not sure which 16GB (2 x 8GB) kit would be both compatible and give

  • Change Adapter Specific Message Attributes with ABAP Mapping

    Hi everyone, I have an IDOC -> PI -> File scenario and I need the file name to be a combination of several fields of the file so variable substitution is quite complicated. I have been reading about Adapter Specific Message Attributes and since the F

  • Could not open password protected site.

    iWeb 09 doesn't allow capital letters in usernames for password protected sites. My site had been built using 08 and it would not open. I republished using iWeb 09 and no caps and it now works.