RandomAccessFile writes only around 2024  lines!

Hi all,
I have a slight problem.
I have created a little program that helps me with some processing. I had a file with a list of 8000 products (some occuer more than once), and a seperate file with a list of prices for each of the products (in mixed up order). So wot I did was read the first product from the product file and then search for the price in the second file, get the value and write to a third file the product and the price with a tab in between (to create a tab delimited file).
I am using 3 RandomAccessFiles, 2 i read from using raf.readLine() method and 1 write to using raf.writeChars(string)
Everytime after writing line 2024 (or 2025) i get an IOException...
(this happens after about a couple of mins as the alogirthm is quite slow but that doesnt concern me, better than sitting a whole month editing in Excel)
Can anyone help??

Thankyou for your help, i've worked out the problem.
i was opening a randomaccessfile in a while loop without closing it!
So was ending up with too many open files after 2025 or files open it gives up. n e way i fixed the problem.
much appreciated.

Similar Messages

  • Only the last line item is shown in main window...

    Hello Experts,
    I created a custom form for the standard checque program RFFOUS_C. Now, in my MAIN window, I
    called a subroutine in a custom program which loops through the line items but the problem is
    only the last line item is being shown. I tried using CONTROL_FORM to create a new line
    but it does not work. Note that I did not customize RFFOUS_C since it is being used by
    multiple companies. Below is my code:
    SAPSCRIPT:
    510-C
    Begin of insertion DEVK940799 11/10/2008 DEL_HIDALGO
    DEFINE &LTYC_XBLNR& = ''
    DEFINE &LTYC_BLDAT& = ''
    DEFINE &LTYC_SGTXT& = ''
    DEFINE &LTYC_DMBTR& = ''
    PERFORM WRITE_LINE_ITEMS IN PROGRAM Z9999RFI_Z2574FFI_RA
    USING &REGUH-LAUFD&
    USING &REGUH-LAUFI&
    USING &REGUH-XVORL&
    USING &REGUH-ZBUKR&
    USING &REGUH-LIFNR&
    USING &REGUH-VBLNR&
    CHANGING &LTYC_XBLNR&
    CHANGING &LTYC_BLDAT&
    CHANGING &LTYC_SGTXT&
    CHANGING &LTYC_DMBTR&
    ENDPERFORM
    PROTECT
         &LTYC_XBLNR&     &LTYC_BLDAT&     &LTYC_SGTXT&     &LTYC_DMBTR&
    ENDPROTECT
    End of insertion DEVK940799 11/10/2008 DEL_HIDALGO
    PROGRAM:
    IF gt_regup[] IS NOT INITIAL.
        CALL FUNCTION 'OPEN_FORM'
           EXPORTING
    *         APPLICATION                       = 'TX'
    *         ARCHIVE_INDEX                     =
    *         ARCHIVE_PARAMS                    =
    *         DEVICE                            = 'PRINTER'
    *         DIALOG                            = 'X'
             form                              = lcc_z2574ffi_ra
    *         LANGUAGE                          = SY-LANGU
    *         OPTIONS                           =
    *         MAIL_SENDER                       =
    *         MAIL_RECIPIENT                    =
    *         MAIL_APPL_OBJECT                  =
    *         RAW_DATA_INTERFACE                = '*'
    *         SPONUMIV                          =
    *       IMPORTING
    *         LANGUAGE                          =
    *         NEW_ARCHIVE_PARAMS                =
    *         RESULT                            =
           EXCEPTIONS
             canceled                          = 1
             device                            = 2
             form                              = 3
             OPTIONS                           = 4
             unclosed                          = 5
             mail_options                      = 6
             archive_error                     = 7
             invalid_fax_number                = 8
             more_params_needed_in_batch       = 9
             spool_error                       = 10
             codepage                          = 11
             OTHERS                            = 12.
        IF sy-subrc <> 0.
    *        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    *                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
        LOOP AT gt_regup INTO lw_regup.
          m_line_items 'LTYC_XBLNR' lw_regup-xblnr.
          m_line_items 'LTYC_BLDAT' lw_regup-bldat.
          m_line_items 'LTYC_SGTXT' lw_regup-sgtxt.
          m_line_items 'LTYC_DMBTR' lw_regup-dmbtr.
          DELETE ex_output WHERE value IS INITIAL.
          CALL FUNCTION 'WRITE_FORM'
           EXPORTING
             element                        = '510-C'
             function                       = 'APPEND'
    *         TYPE                           = 'BODY'
             window                         = 'MAIN'
    *       IMPORTING
    *         PENDING_LINES                  =
           EXCEPTIONS
             element                        = 1
             function                       = 2
             type                           = 3
             unopened                       = 4
             unstarted                      = 5
             window                         = 6
             bad_pageformat_for_print       = 7
             spool_error                    = 8
             codepage                       = 9
             OTHERS                         = 10.
          IF sy-subrc <> 0.
    *        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    *                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
          CALL FUNCTION 'CONTROL_FORM'
            EXPORTING
              command   = 'NEW-LINE'
            EXCEPTIONS
              unopened  = 1
              unstarted = 2
              OTHERS    = 3.
          IF sy-subrc <> 0.
    *        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    *                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
        ENDLOOP.
        CALL FUNCTION 'CLOSE_FORM'
    *       IMPORTING
    *         RESULT                         =
    *         RDI_RESULT                     =
    *       TABLES
    *         OTFDATA                        =
           EXCEPTIONS
             unopened                       = 1
             bad_pageformat_for_print       = 2
             send_error                     = 3
             spool_error                    = 4
             codepage                       = 5
             OTHERS                         = 6.
        IF sy-subrc <> 0.
    *        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    *                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDIF.

    Hi,
    Write the at last event in the program and check if it works
      At last.
           CALL FUNCTION 'CONTROL_FORM'
            EXPORTING
              command   = 'NEW-LINE'
            EXCEPTIONS
              unopened  = 1
              unstarted = 2
              OTHERS    = 3.
          IF sy-subrc  0.
           MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
    Regards,
    Sravanthi

  • Java write/append to each line of a text file

    I have spent numerous hours trying to figure out what I am doing wrong. If anyone more experienced could tell me what is wrong with my code.
    I have a very simple text file with 5 lines:
    line1
    line2
    line3
    line4
    line5
    All I am trying to do is append some string to the end of each of those lines. Everytime I run my code, it erases all content but does not write/append anything to the file. Any help is greatly appreciated.
    Thanks! I am about to throw this monitor out the window!!
    package Chapter6;
    import java.io.*;
    public class fileNavigation2 {
         public static void main(String[] args) {
              File dir = new File("C:\\testing");
              System.out.println(dir.isDirectory());
              try {
                   File file = new File(dir, "Test.txt");
                   FileReader fr = new FileReader(file);
                   BufferedReader br = new BufferedReader(fr);
                   FileWriter fw = new FileWriter(file);
                   BufferedWriter bw = new BufferedWriter(fw);
                   String s = "Add1,";
                   String s2 = "Add2\n";
                   String str;
                   while((str = br.readLine()) != null) {
                   StringBuffer sb = new StringBuffer(str);
                   sb.append(s + s2);
                   String y = sb.toString();
                   System.out.println(sb);
                   System.out.println("Appending");
                   bw.write(y);
                   bw.close();
                   System.out.println("Done");
              }catch(IOException e) {}
    }

    First, thanks a lot for your feedback. The code makes a lot of sense but it does not update the content of my Test.txt file.
    I only edited the line of code that creates the new file so that it could find the location of the file.
    Scanner file = new Scanner(new File("C:\\testing",fileName));==============================
    The code now looks like:
    import java.io.*;
    import java.util.*;
    public class Main {
        static void appendTo(String fileName, String[] newLines) throws IOException {
            List<String> allLines = getLinesFrom(fileName);
            for(String line : newLines) {
                allLines.add(line);
            writeLinesTo(fileName, allLines);
        static List<String> getLinesFrom(String fileName) throws IOException {
            List<String> lines = new ArrayList<String>();
            Scanner file = new Scanner(new File("C:\\testing",fileName));
            while(file.hasNextLine()) {
                lines.add(file.nextLine());
            file.close();
            System.out.println(lines);
            return lines;
        static void writeLinesTo(String fileName, List<String> lines) throws IOException {
            BufferedWriter out = new BufferedWriter(new FileWriter(fileName));
            for(String line : lines) {
                out.write(line);
                out.write(System.getProperty("line.separator"));
            out.close();
        public static void main(String[] args) {
            String fileName = "Test.txt";
            String[] extraLines = {
                    "a new line",
                    "and yet another new line"
            try {
                appendTo(fileName, extraLines);
                System.out.println("Done.");
            } catch (IOException e) {
                e.printStackTrace();
    }Again, thanks for the help.

  • How to write data in differt line in .txt file

    Hi all,
    I am tring to write data on one file using utl_file,
    the first cursor loop write data on first line of the file using
    utl_file.put_line(..........................);
    end the second cusor loop write the data on secion line of the same file using
    utl_file.put_line(..........................);
    file format we are given as .txt;
    problem we are facing is when we open the file in notepad all the data is showing in one line...
    same file if we open another tools like edit plus, word pad etc it showing the write formate( line by line)
    Can any one help on this we need to set any setups in note pad????????????/

    As others have said it sounds like an operating system difference.
    If your Oracle is installed on a unix based server then the file will be written using Unix style newlines which are just Line Feed characters.
    In Windows environments a newline is considered to be made of the Carriage Return/Line Feed character pair, not just the Line Feed.
    Some applications such as MS Word or Wordpad can read Unix style linefeeds and interpret them as you expect as a Newline. However Notepad doesn't.
    When you transfer the file from Unix to Windows, usually this is done using an FTP based mechanism. If you transfer the files using FTP Binary mode, then every byte of the file is transferred as it is on Unix, and the file will essentially be a unix file on a windows system. If, however, you transfer the files (from Unix to Windows) using FTP ASCII mode, then whenever FTP encounters a LineFeed character it will convert it to a Carriage Return/LineFeed pair of characters, so that the file will appear correctly in Notepad. Likewise if you transfer files from Windows to Unix in ASCII mode, then Carriage Return/LineFeed pairs of characters are converted to just a LineFeed character so that the file becomes Unix compatible. Note, you shouldn't transfer binary files in ASCII mode as it can corrupt them, it's only intented for text based files.

  • Client sends entire message, Server only sends first line...

    I can send a three lined message to the server, but I can only send one line back and as far as I'm aware I'm using the same stuff either side so it should be fine? Maybe someone here can I point out where I'm going wrong...
    Client
    package Assignment;
    // EchoClient.java
    // This attempts to connect to the echo port of a server.
    // e.g. java EchoClient [IPaddr]
    import java.io.*;
    import java.net.*;
    public class EchoClient {
        public void EchoClient() {
        }     // constructor
        public static void main(String[] args) throws IOException {
            HTCPCPProtocol htcpcp = new HTCPCPProtocol();
            Socket echoSocket = null;
            PrintWriter out = null;
            BufferedReader in = null;
            String host = "localhost";
    //String host = "127.0.0.1"; //modify read in
            int portNo; // modify read in
            if (args.length != 0) {
                host = args[ 0];
            BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
            String userInput;
            do {
                System.out.print("Enter some text to echo (END = exit): ");
                System.out.flush();
                userInput = stdIn.readLine();
                try {
                    echoSocket = new Socket(host, 3456); // modify so portNo is cmd line!
                    out = new PrintWriter(echoSocket.getOutputStream(), true);
                    in = new BufferedReader(new InputStreamReader(echoSocket.getInputStream()));
                catch (UnknownHostException e) { // hostname cannot be resolved to ipaddr!
                    System.err.println("Don't know host named: " + host);
                    System.exit(1);
                } catch (IOException e) { // ipaddr doesn't locate a host
                    System.err.println("Couldn't get I/O for " + "the connection to: " + host);
                    System.exit(1);
                //String message = htcpcp.constructRequestMessage(userInput);
                String message = "\r\n"+"BREW "+" "+ "\r\n"
                    +"Accept Additions:#"+"\r\n"+
                    "Coffee Pot/message=start";
                out.println(message);
                out.flush();
                System.out.println(in.readLine()); // should print entire message
            } while (!userInput.equals("END"));
            out.close();
            in.close();
            stdIn.close();
            echoSocket.close();
        } // main
    } // class EchoClientServer
    package Assignment;
    //  EchoServer.java
    //  Acts as an echo server.
    //  Client must connect on the correct port.
    //  Server closes the connection on receiving 'END'.
    //  But keeps running for more client connections.
    //  Give the port number as a command line argument:
    //    e.g. java EchoServer [4567]
    import java.io.*;
    import java.net.*;
    public class EchoServer {
        public final static int DEFAULT_PORT = 3456;
        public final static int qLen = 3;   // number of clients that can q
        public void EchoServer() {
        public static void main(String[] args) throws IOException {
            HTCPCPProtocol htcpcp = new HTCPCPProtocol();
            ServerSocket listenSocket = null;
    //    OutputStreamWriter osw = null;
            PrintWriter osw = null;
            InputStreamReader isr = null;
            BufferedReader br = null;
            int portNum = DEFAULT_PORT;
            int clientNo = 0;                 // count clients serviced
            if (args.length != 0) {
                try {
                    portNum = Integer.parseInt(args[ 0]);
                    // put some test here to allow for port number not in range
                } catch (NumberFormatException nfE) {
                    System.err.println("Illegal port number: " + args[ 0]);
                    System.err.println("\tUsing the default: " + DEFAULT_PORT);
            try {
                listenSocket = new ServerSocket(portNum, qLen);
            } catch (BindException e) {
                System.err.println("Could not bind to port: " + portNum);
                System.err.println("\tIs it already in use?");
                System.err.println("\tIs it a reserved port number?");
                System.exit(1);
            while (true) {                // loop forever accepting clients
                Socket clientSocket = null;
                // try changing for isr rather than br
                String request = null;
                try {
                    clientSocket = listenSocket.accept();     // actual comms socket!
                    ++clientNo;                               // count clients serviced
                    //osw = new OutputStreamWriter( clientSocket.getOutputStream());
                    osw = new PrintWriter(clientSocket.getOutputStream(), true);
                    //     out = new PrintWriter(echoSocket.getOutputStream(), true);
                    System.out.println("Connection from: " + clientSocket.getInetAddress());
                    br = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
                    do {
                        request = br.readLine();
                        System.out.println(request);
                        String responseMessage = "HTCPCP/0.1"+"\r\n"
                    +"safe:yes"+"\r\n"
                    +"Accept Addition:#"+"\r\n"
                    +"Coffee Pot/message=start"+"\r\n";
                        //osw.write( "Hello from "+ InetAddress.getLocalHost() + " to Client no:" + clientNo + "\r\n");
                        String response = htcpcp.OKResponseMessage();
                        osw.write(responseMessage);
                        osw.flush();
                    } while (!request.equals("END"));
                    System.out.println("Client " + clientNo + " closed connection");
                    osw.close();
                    isr.close();
                    br.close();
                    clientSocket.close();
                } // end try{} accepting a client connection
                catch (IOException ioE) {
                    System.err.println("Connection error, maybe the client died!");
                } finally {                           // to trap any other errors!!
                    try {
                        if (clientSocket != null) {
                            clientSocket.close();
                    } catch (IOException ioE) {
                } // end of finally
            } // while forever waiting for a client connection
        } // main
    } // class EchoServer

    aaron101 wrote:
    Hmm, tried it again and it printed the 'safe:yes' line and the 'coffeepot' line... repeated that sequence 4 times.
    I tried changing the while loop too...
    while (in.readLine != null | in.readLine == null) {
    System.out.println(in.readLine()); // should print entire message
    }The output was...
    Accept..
    safe...
    HTCPCP...
    Coffee...
    Accept...
    Am I far from the solution to this problem? Cos I've been stuck on this for two days straight now. Seems so trivial!That shouldn't compile. Assuming you meant in.readLine() everywhere you wrote in.readLine, now you're reading 3 lines every time thru the loop and only printing every 3rd one.
    So no, you're not getting any closer.
    A typical pattern:
    while (true)
      String line = in.readLine();
      if (line == null)
        break; // get out of the loop; no more input
      System.out.println(line);
    }

  • Arraylist only reading first line of file

    I am reading a text file using an arraylist. my file has a single value on each line e.g.
    2
    3
    4
    5
    however this method is only reading only the first line of each file. is it because of this statement:
    String s1[] = number.split("\\s");
    I would like to change the method so its not expecting numbers in a single line.. but reads each line and adds it to the collection... how can I do that?
    here is getData method that gets the file and processes it.
         public static List<Integer> getData(String Filename) {
              List<Integer> array1 = null;
              // BufferedReader for file reverse.txt
              try {
                   array1 = new ArrayList<Integer>();
                   BufferedReader bf = new BufferedReader(new FileReader(Filename));
                   String number = bf.readLine();
                   String s1[] = number.split("\\s");
                   for (int i = 0; i < s1.length; i++)
                        array1.add(Integer.parseInt(s1));
              } catch (Exception e) {
                   e.printStackTrace();
              return array1;

    Faissal wrote:
    while(bf .ready()){
    readline() will return null if the end of the stream has been reached. ([http://java.sun.com/javase/6/docs/api/java/io/BufferedReader.html]). This condition can be used to determine when to stop reading thereby ensuring that all lines have been read.
    EDIT:
    Here's a code snippet from [Java Developers Almanac|http://www.exampledepot.com/egs/java.io/ReadLinesFromFile.html]: notice how they close() the stream when they're finished with it.

  • Header Details to be Printed only for the line item details.

    Hi All,
    I have the following requirement.
    I have Page1 with the Logo, Header Window, Vendor Window, Send Invoice To, Delivere Invoice To and Main Window. Main Window Starts from the middle of the page. In the Page2 i have Logo, Header window and Main Window. In the Page3 i have only Main Window.
    In the Footer of the Main Window i have Placed the Terms and conditions which should always be Printed in the New Page. So in the footer i have given a command "Go to New Page " and given the page as Page3.
    The requirement is Logo,and Header Window should appear only for the Line items and not for the Terms and conditions.
    For the Page1 i have given the Next Page as Page2. Suppose if there is only one line item then it Prints in the first Page itslef and the control flows to the Page2 and since in the page2 i have given the condition for the Logo and header window to print only if line item is more than 1 and since Main Window is starting from the middle there is a blank Space appearing in the start of the page.
    The command i have given in the footer to trigger new page that is page3 is not getting triggered. If there are more than one line item then its printing the logo and header window and so there is no blank space appearing and it is working fine.
    Please let me know how to avoid this blank space and move my main window to the start of the Page if there is only one line item.
    Thank you.

    Dear Vasudha,
    I am a little bit confused regarding your query,
    "In the Footer of the Main Window i have Placed the Terms and conditions which should always be Printed in the New Page. So in the footer i have given a command "Go to New Page " and given the page as Page3. "
    When you say footer of main window does it mean , that you are using a table inside your main window and the command node your have inserted is in the footer of the table ?.I hope it is, because my suggestion is based on this assumption.
    Well my suggestion for your issue is,
    1.I  hope you are aware we can trigger a next page in two ways, one by setting the next page static attribute & second using  the command node which you have used.In your case you will have to use a combination of both.
    2.I feel your First page design is ok. Set its static next page attribute to PAGE2. Similarly set the static next page attribute for PAGE2 as PAGE2 itself. This should take care of your table which you have placed in the main window. If the table contains only one lineitem it will get over in the first page itself. If the lineitems are more in the table, it will automatically triggerPAGE2 (since static next page attribute for PAGE1 is PAGE2)  and the remaining line items will be displayed. Now no matter how many lineitems you have ,PAGE2 will be triggered repeatedly(since static next page for PAGE2 is PAGE2 itself) until the entire data in your table is displayed.
    In this way your requirement of printing the logo and header windows for the data lineitems only will be fulfilled.
    3.Now the last catch in your case is the printing of PAGE3(The terms and condition page) on an entirely new blank page.
       In the footer section of the table which you have used,  use a command node set to PAGE3.  After the command node and under the same  footer section now insert your terms and condition lineitem.
    Also Check the "at End of table" checkbox and uncheck " AT PAGE BREAK" under OUTPUT OPTIONS tab for the footer section.
    So now this footer section will be triggered only once after all the data in the table is displayed
    4. So now if there is only one lineitem, before the default second page is triggered the command node will trigger the PAGE3 and the terms and condition will be displayed.Else if there are more lineitems the page2 will be triggered again and again and finally when all the lineitems are over, the footer of the table will get triggered. So the command node will take you to the PAGE3 wherin the terms and condition will only be displayed.
    Hope this helps.
    Regards,
    Riju

  • How to set a coil as write only?

    Hello,
    Lookout 6.6
    How do you set a modbus member, i.e. a coil (point 1 for example) as write only?
    Thanks in advance.
    Bruce
    Here's a bit more detail.  Our RTUs communicate via radio so latency is a factor.  Lookout always is trying to read from these write only coils and this causes additional delays. If we could eliminate all the unnecessary radio traffic that Lookout creates reading coils that are write only, it would be very helpful. 

    Thank you, a great suggestion (having two objects)
    I will do some experiments...
    From what I've seen from the trace, Lookout immediately reads the coil after the write, i.e. not as part of the poll, inorder to sync with the hardware.  I wish I could turn this off.  
    Thanks again.

  • I'm doing a scan around a line by sampling data 360 degrees for every value of z(z is the position on the line). So, that mean I have a double for-loop where I collect the data. The problem comes when I try to plot the data. How should I do?

    I'm doing a scan around a line by sampling data 360 degrees for every value of z(z is the position on the line). So, that mean I have a double for-loop where I collect the data. The problem comes when I try to plot the data. How should I do?

    Jonas,
    I think what you want is a 3D plot of a cylinder. I have attached an example using a parametric 3D plot.
    You will probably want to duplicate the points for the first theta value to close the cylinder. I'm not sure what properties of the graph can be manipulated to make it easier to see.
    Bruce
    Bruce Ammons
    Ammons Engineering
    Attachments:
    Cylinder_Plot_3D.vi ‏76 KB

  • Reason: Error in sieve filter: Unknown function/variable found: church around input line 79 [ stop; } require " f^ileinto"; if header ]

    My wife's email has been getting filled with hundereds of emails with this in them this morning. I don't see where anyone else is having this problem today, but I wanted to see if it's on iCloud's end or ours.
    Processing errors occurred during delivery:
    Recipient address: [email protected]
    Reason: Error in sieve filter: Unknown function/variable found: church around input line 79 [ stop; } require " f^ileinto"; if header ]
    Delivery processing continued in spite of these errors.
    Reporting-MTA: dns;ms21034.mac.com (tcp_intranet-daemon)
    Arrival-date: Tue, 13 Mar 2012 07:33:18 +0000 (GMT)

    My Wife and I both have an Ipad and an iPhone, I use an iMac and my wife a MacBook Pro.
    I have this problem with all my devices.
    My wife has NOT got this problem.
    We both use a [email protected] email acount.
    Just compared the settings:
    For "Incoming server" I have p03-imap.mail.me.com
    My Wife has p02-imap.mail.me.com .... and has not got this problem.
    I have setup a new rule for incoming mails (for the meantime):
    move all incoming emails from [email protected] to trash and delete it.
    Works fine for now,......until APPLE deals with the problem.
    Message was edited by: RTONLINE

  • How to write on a new line ("\n") to a file

    I dont know how to write on a new line ... this method writes everything in long line. I tried doing pS.println("\n") before the pS.println(buffer.toString());
    Some one please direct me :)
    public void WriteToFile() {
         try {
              byte[] record = new byte[100];
              ByteArrayInputStream iS = new ByteArrayInputStream(record);
             DataInputStream iDS = new DataInputStream(iS);
              StringBuffer buffer = new StringBuffer();
              OutputConnection connection = (OutputConnection)
                                          Connector.open("file:///CFCard/readme.txt");
              OutputStream oS = connection.openOutputStream();
              PrintStream pS = new PrintStream( oS );          
              try {
               for(int x=1; x<=rs.getNumRecords();x++) {
               rs.getRecord(x, record, 0);                                                                                               
                  buffer.append(iDS.readUTF());                          
                  buffer.append(iDS.readUTF());              
                  buffer.append(iDS.readInt());              
                  buffer.append(iDS.readInt());              
                  buffer.append("\n");
                  pS.println("\n");
                  pS.println(buffer.toString());                                          
                 iS.reset();                   
              oS.close();
              connection.close();
             iS.close();
             iDS.close();        
              catch(ConnectionNotFoundException err) {
                   Alert alert = new Alert("Error", "Cannot access file.", null, null);
                 alert.setTimeout(Alert.FOREVER);
                 alert.setType(AlertType.ERROR);
                 display.setCurrent(alert);     
              catch(IOException err) {
              Alert alert = new Alert("Error", err.toString(), null, null);
            alert.setTimeout(Alert.FOREVER);
            alert.setType(AlertType.ERROR);
            display.setCurrent(alert);     
              Alert alr = new Alert("Completed Sending to a File", "Data written successfully!",null,null);
              alr.setTimeout(Alert.FOREVER);
              alr.setType(AlertType.WARNING);
              display.setCurrent(alr);
              }catch(Exception err) {
    }

    Stinkin' crossposter
    http://forum.java.sun.com/thread.jspa?threadID=613784

  • I dropped my Iphone 5 which resulted in it shattering and the screen was still on but it was black with only a white line through it so I couldnt access the phone however I switched over to my Droid and now I cannot send or receive messages?

    I dropped my Iphone 5 which resulted in it shattering and the screen was still on but it was black with only a white line through it so I couldnt access the phone however I switched over to my Droid and now I cannot send or receive messages and I cant turn off imessage because I cant see anything on the screen.  Help?

    Then the bottom of the support document states that if you do not have access to the device (which unfortunately because of the screen issue you do not) to contact Apple Care. That is what you need to do.

  • Collecting Responses only collects first line in distributed form

    Does anyone know if this is a common problem with a known solution? I have a distributed dynamic form which starts out with one line. The user fills it in, then adds additional lines when necessary. User then uses the submit via email button on the form to email the form back to me. I receive the form, and am prompted to save response into a response file. However, when viewing the response file, only the first line of the form is entered, even though the user has added and filled in multiple lines. Any idea what is causing this?
    Thanks,
    Jo
    Edit: Actually, when I export it as a CSV file and open it in Excel, the data is there, but it is spread out...i.e., each line that has been added by the user is appended as additional columns, not as additional rows. I really only need to view it in Adobe, so is there any way of getting ALL of the collected data to display in the Adobe form collector?

    http://forums.adobe.com/community/livecycle/livecycle_es/livecycle_designer_es

  • Can't open mail on Facebook, can't write more than 2 lines in the status on Facebook and there are no "older posts" showing on Facebook

    This is regarding Facebook: I can no longer open mailbox to receive or send. The result is a white page with the Facebook index on the left. I can no longer write more than 2 lines in status updates. Lastly, the "older posts" that is usually at the bottom of the page is no longer there. Incidentally, all these things work in IE. There's nothing in Facebook referring to these issues except to say it doesn't support Firefox 3.6.8.

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Step 1
    Enter the name of the crashed application or process (Finder) in the Filter text field. Post the messages from the time of the last crash, if any — the text, please, not a screenshot.
    When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    Please do not indiscriminately dump thousands of lines from the log into a message.
    Important: Some private information, such as your name, may appear in the log. Edit it out by search-and-replace in a text editor before posting.
    Step 2
    Still in the Console window, look under User Diagnostic Reports for crash reports related to the process. The report name starts with the name of the crashed process, and ends with ".crash". Select the most recent report and post the contents — again, the text, not a screenshot. In the interest of privacy, I suggest that, before posting, you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if it’s present (it may not be.) Please don’t post shutdownStall, spin, or hang logs — they're very long and not helpful.

  • Print RFKORD50 only for customer line ?

    I have to print credit note only for  customer line (account type 'D'). Then I use TCode F.62 using printing program RFKORD50. But RFKORD50 will print for customer & vendor line.
    Could you please to help me to only print customer line ?
    Is there any better printing program ?
    Thanks in advance.

    Try out this.
    If your query is something like this
    Select col1,col2,col3,col4 from tab1
    now you have pulled col1,col2,col3 from the group and have formed the group left.
    Select Col1,col1 col1_1,....
    Select each column twice from the select stmt.
    Let me know whether this works.

Maybe you are looking for

  • NEWBIE JSP QUES

    I'm really new at jsp, and have a frustratingly simple question. All I'm trying to do is get a .jsp page to display in internet explorer. So I create the file and put this in it: <% String test = "this is a test"; %> <html> <%=test%> </html> And noth

  • Help choosing MacBook Pro

    I want tog et rid of my current MacBook Pro. It is a 17-inch 2.6GHz from early 2008. Since the case is 2 separate parts the screws are become loose and the top case starts to move and wiggle a lot which is really annoying. Also I never thought about

  • Starting a resource action on its own

    I have heard that it is possible to start a resource action on its own -- ie, not run as a before/after action for any of the normal operations. It makes sense that this can be done but it is not documented. Can someone please give me an idea of how

  • JTable  error!!!

    Guys, I got the code below compiled, but it does not run. I wanna start the JTable depending on a integer value. I have a runtime error. I placed it in the bottom... //stackSize is defined before, and it's value is ok. public class Pilha extends JFra

  • Can't get icloud to download back to my PC

    I can't get my contacts to download back to my PC in outlook 2007.  They sync between by iphone 3gs and my Ipad 2 just fine, but on the setup screen it just gets stuck on step 2 of 5 uploading and downloading contacts to icloud.  If I let it sit ther