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.

Similar Messages

  • 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

  • [Solved] Shell script to read unhashed lines from file.

    Hello.
    I want to write a shell script  (it can be bash,sh,ksh,csh or zsh) that will be:
    1.Read unhashed lines from file named mirrors.conf.
    2.Put them in ~/.profile as PKG_PATH=line catted from mirrors.conf.
    Just like as mirrors.conf file for pacman.
    Now it can cat lines but how to put them in files as PKG_PATH?
    Thanks for answers.
    Last edited by SpeedVin (2010-03-01 17:33:20)

    res wrote:
    ^ IFS is not necessary here; it won't mess with the white space:
    $ echo 'args with formatted spaces ' | while read -r; do echo "$REPLY"; done
    args with formatted spaces
    It matters for leading/trailing whitespace:
    $ echo ' after some ' | while read -r line; do echo "<$line>"; done
    <after some>
    $ echo ' after some ' | while IFS= read -r line; do echo "<$line>"; done
    < after some >

  • QT Pro 7.6 image sequencing aperture exports - only reads first file

    I'm exporting versions (jpg) of files that are originally Nikon raw (NEF) format.
    I'm testing with a bunch of images that were grabbed using the camera's continuous mode - want to make sure the system works before doing any real playing with time lapse.
    I have a folder with the images - all named image01.jpg, image02.jpg etc etc. No other files in the folder.
    Open QT Pro 7.6 - choose Open Image Sequence and select the first image.
    It asks for the frames per second.
    Whatever i pick - it creates a single frame movie with the first image in the set.
    I've tested with two different exports - same issue.
    Any hints?

    OK - tried this.
    For a short test - I have 22 files.
    -rw-r--r-- 1 chris staff 4428188 May 1 23:58 1.jpg
    -rw-r--r-- 1 chris staff 4634772 May 1 23:58 2.jpg
    -rw-r--r-- 1 chris staff 4451476 May 1 23:58 3.jpg
    -rw-r--r-- 1 chris staff 4564699 May 1 23:59 4.jpg
    -rw-r--r-- 1 chris staff 4450224 May 1 23:59 5.jpg
    -rw-r--r-- 1 chris staff 4344569 May 1 23:59 6.jpg
    -rw-r--r-- 1 chris staff 4637089 May 1 23:59 7.jpg
    -rw-r--r-- 1 chris staff 4143277 May 1 23:59 8.jpg
    -rw-r--r-- 1 chris staff 4144009 May 2 00:00 9.jpg
    -rw-r--r-- 1 chris staff 4311011 May 2 00:00 10.jpg
    -rw-r--r-- 1 chris staff 4054440 May 2 00:01 11.jpg
    -rw-r--r-- 1 chris staff 4020426 May 2 00:01 12.jpg
    -rw-r--r-- 1 chris staff 4382219 May 2 00:01 13.jpg
    -rw-r--r-- 1 chris staff 4315001 May 2 00:02 14.jpg
    -rw-r--r-- 1 chris staff 4084161 May 2 00:02 15.jpg
    -rw-r--r-- 1 chris staff 3772054 May 2 00:02 16.jpg
    -rw-r--r-- 1 chris staff 3363054 May 2 00:03 17.jpg
    -rw-r--r-- 1 chris staff 3392872 May 2 00:03 18.jpg
    -rw-r--r-- 1 chris staff 2956213 May 2 00:03 19.jpg
    -rw-r--r-- 1 chris staff 3063359 May 2 00:03 20.jpg
    -rw-r--r-- 1 chris staff 2728311 May 2 00:04 21.jpg
    -rw-r--r-- 1 chris staff 2877868 May 2 00:04 22.jpg
    Now - when they were called image01, image02 etc I got a 1sec movie with only the first image.
    Now - with these names - I get a movie of the correct duration (so - for example - 2 frames a sec yields an 11 sec movie) but with only the first shot shown (in other words I get to see the first jpg for 11 secs in the 2/s example.
    The file command tells me that they are "JPEG image data, JFIF standard 1.01"

  • File Sender Adapter Skip first line in file

    Hello to all,
    I'm trying to read a file (nfs) using the file adapter.
    The szenario works fine, but I need to skip the first line in the txt file (header line)
    I tried parameter documentSkipFirstRows, without success.
    Any ideas?
    Regards Christian

    Hi Kaiser,
    May be the syntax problem.
    use like this...
    xml.documentSkipFirstRows     1
    Syntax is
    xml.documentSkipFirstRows=<noOfRows>
    for more info refer this link..
    http://saphelp.border-states.com/EN/0d/00453c91f37151e10000000a11402f/frameset.htm
    Verify this...
    Thanks.

  • Map with 500 pdfs. How to make a new file with only the first pages, new file with second pages etc.

    Hi,
    A client confronted me with the next question:
    I have a map with 500 pdf's in it.
    Is it possible to make a new file with only the first page of each pdf?
    After that to make a new file with only the second page of each pdf?
    And after that the third?
    Etc.
    Is that possible with an action?
    Or are there scripts for?
    I couldn't find them.
    I use an iMac with Acrobat XI.
    Any help is very welcome.
    Thanks in advance.
    Bornholm

    You can extract each page from each pdf as a seperate page.     Once this is done you can select the pages tocombine.
    You would have to write custom a custom JavaScript and programatically code the names to combine if the extracted file pages habvestandars naming that could  be programed. There maybe some security  coding you will have to do because of Adobe restrictions but this all documented in the Acrobat JavaScript Reference.

  • Deleting first line off file

    Hello,
    I want to remove the first line of a file. Is there any way to do that
    without reading the whole file and putting it in a huge string?
    Something like setting the "begining of file marker" (does that
    exist?). I've looked in the "advanced file function" and can't find a
    way to do it.
    Any suggestion?
    Thanks a lot!!
    Vincent

    I don't see any Read File by Lines vi in LV7.1.  Maybe it exists in LV 8.  However there is a Read Lines from File vi but it does not produce an array of lines (at least not in LV 7.1).  You can use the Read Lines from File vi and set the number of lines to 1.  The output mark after read is now set to point to the second line.  You can use this as an input to start of read offset on your next read call.  This vi will open the file, read, then close the file.  Calling it a second time will open the file again, read, then close again.
    Another way is to open the file using Open/Create/Replace File.  Then use Read File and set the Line Mode input to True.  This will read the first line.  A second Read File call will then begin reading at the second line without having to wire any offsets.  After reading all that you want, you close the file.  One open, several reads, one close.  This is more efficient.
    Message Edited by tbob on 03-06-2007 03:03 PM
    - tbob
    Inventor of the WORM Global
    Attachments:
    ReadLines.png ‏4 KB

  • 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);
    }

  • Why would only the first line of my data set txt file work?

    Hi -
    I had a lot of success using variables and external data sets until today.
    I have an external text file that I have imported as a data set (Image/Variables/Data Sets/Import...).  All of the variables have been defined and confirmed (at least PSD hasn't told me it can't find something which is the typical error msg.)
    This external text file, with the extension ".txt" has 12 lines on it, each line is 7 comma separated values, and each line is ending in a carriage return.
    YESTERDAY when I used File/Export/Export Data Set as Files... the procedure went beautifully for the 8 times I used it.  TODAY I only get the first of the 12 lines completed and then the export stops.  There are no error messages or other signs that Photoshop has choked on something so I guess something is wrong with my text file... BUT WHAT??
    Any insight on any step in this would be helpful.  You all know that if I'm using this feature it's because I have TONS of repetition ahead of me if it doesn't work.
    TIA your expertise,
    JL

    Fixed it!
    When Exporting as Data sets as files... the step I missed was to select "All Data Sets" from the Data Set drop down.
    Thanks all.
    JL

  • Reading Multiple lines using File Adapter in PI 7.1

    Hi Friends,
    We are using PI 7.1 Service pack 4, scenario is File to IDOC .
    I am using  Sender File Adapter with File content conversion for fixed lengths to read file from FTP XI-SAP.
       File Format :
      EDI_DC40 , A, B, C, D, E
      E1WPU01, F, G,H, I
      E1WPU02 , J,K,L
      E1WPU02 , J,K,L
    I have maintained Fcc parameters . I am able to read files for mulitple rows when manually set the count in recorset structure
    like :
    Recordset Structure : EDI_DC40,1, E1WPU01,1, E1WPU02,2...
    Problem is when I set * in  Recorset Structure  : EDI_DC40,1, E1WPU01,,E1WPU02,
    Nothing is coming .
    Could anyone help me how to resolve this issue.
    Regards,
    Vijay

    Hi Vijay,
    As u mentioned in earlier post...
    keyfieldName = TABNAM
    EDI_DC40.fieldNames :
    EDI_DC40. fieldFixedLengths:
    EDI_DC40.keyFieldValue :
    E1WPU01.fieldNames :
    E1WPU01.fieldFixedLengths:
    E1WPU01.keyFieldValue
    E1WPU02.fieldNames :
    E1WPU02.fieldFixedLengths:
    E1WPU02.keyFieldValue
    Here actually you are trying to get the key field value even from EDI_DC40 and E1WPU01 also....
    So obviously u dnt have those values in that rows so.. it cannot get the rows....
    So please u try this one..... The same FCC but remove the 2 lines.... for EDI_DC40 and  E1WPU01
    keyfieldName = TABNAM
    EDI_DC40.fieldNames :
    EDI_DC40. fieldFixedLengths:
    E1WPU01.fieldNames :
    E1WPU01.fieldFixedLengths:
    E1WPU02.fieldNames :
    E1WPU02.fieldFixedLengths:
    E1WPU02.keyFieldValue
    I hope this wil solve ur problem..
    Lemme know if any issues...
    Thanks & Regards,
    H.L.Babu

  • "read from measurement file" reads only first line of data

    Hello,
    I have a problem when trying to read a .lvm file through "Read from Measurements file" with the following block diagram
    Problem: it reads only the first line of data from what I can see in the probe window,.
    A part of the lvm file for reference.
    I haven't used Labview in a long long time, I'm trying to figure out what I am doing wrong.
    Thanks

    Sorry meant to attach the lvm. Here it is. (Actually I had to put it in .txt because the forum wont let me upload a lvm file)
    I unfortunately cannot share the full vi that record the data as I am not its owner/creator. I'll try to give as much info as I can with the relevant pictures attached, I hope it allows us to at least have an hint of where the problem might be.
    (this is in a while loop)
    In the stacked sequence, the other pannels are similar to the one shown here: value read fron a variable, converted to dynamic and a signal attribute is set. The "start recording" control operation is "switch when pressed".
    Here are the properties of the set signal attributes
    And here are the properties of the "write to measurement file"
    Attachments:
    NoTarget_full circle__Rx_-10-SAMPLE.txt ‏60 KB

  • PDF showing only first line of Table?

    Hi @,
    I am showing an input table to PDF using adobe Int Form and in the Adobe screen it is displaying only the first line of the table.
    I am using CE 7.1 SR5.
    Regards

    Hi,
    When the XML interface is generated for the context, for every node that has cardinality 0..n or 1..n, a node named DATA is generated in the XML.
    So if your Webdynpro context has foll structure...
    Node1 ... 1..1
      Node2 ... 0..n
        Attrib1
        Attrib2
    The corresponding XML would be
    Node1
      Node2
        DATA
          Attrib1
          Attrib2
    Regards,
    Reema.

  • Only first line printed in Smartform

    Hello,
    I have a form in Arabic langauge text, when I add a text to a window, only the first line of the text (which in the text editor I have more than 3 lines) is displayed. when I start SAP GUI in english I have all the text displayed and only only the first line.
    please help, thanks

    Can you pls tell me , How you are fetching that text?
    1. through Read_text FM?
    2. Through "Text Module" option from smart form screen?
    3. Using Include option in the text editor?
    Rds,
    Lokesh.

  • Module pool- only first line item data saved, rest disappears??

    Hi Experts,
    I have one module pool that was developed by other developer. It has header details input fields and items details input by table control.
    Now below scenarios occur:
    1) When I enter only one line item, and save it, the data is saved properly
    2) when I enter more than one item data and save it, it only saves first line item data.
    3).When I press ENTER button after every new line item data, it saves all the data properly.
    I tried to debug the report but could not find the exact problem statement as the code is written very badly without any comments.
    I am pasting the flow logic code below for the screen.
    So please help me figure out the problem and solution for it.
    +++++++++++++++++++++++++++++++++++
    PROCESS BEFORE OUTPUT.
    *&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'IT_MSEG'
       MODULE it_mseg_change_tc_attr.
    *&SPWIZARD: MODULE IT_MSEG_CHANGE_COL_ATTR.
       LOOP AT   it_gp
            INTO wa_gp
            WITH CONTROL it_mseg
            CURSOR it_mseg-current_line.
         MODULE it_mseg_get_lines.
    *&SPWIZARD:   MODULE IT_MSEG_CHANGE_FIELD_ATTR
       ENDLOOP.
    * MODULE STATUS_9001.
       MODULE deactive_screen.
    PROCESS AFTER INPUT.
    *&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'IT_MSEG'
       LOOP AT it_gp.
         CHAIN.
           FIELD wa_gp-yposnr.
           FIELD wa_gp-matnr.
           FIELD wa_gp-maktx.
           FIELD wa_gp-meins MODULE check_uom ON INPUT..
    *      FIELD WA_GP-DOC_QTY.
    *      FIELD WA_GP-REC_QTY.
           FIELD wa_gp-gp_qty.
           FIELD wa_gp-chall_qty.
           FIELD wa_gp-netwr.
           FIELD wa_gp-remarks.
           FIELD wa_gp-exp_ret.
           MODULE it_mseg_modify ON CHAIN-REQUEST.
         ENDCHAIN.
         FIELD wa_gp-chk
           MODULE it_mseg_mark ON REQUEST.
       ENDLOOP.
       MODULE it_mseg_user_command.
    *&SPWIZARD: MODULE IT_MSEG_CHANGE_TC_ATTR.
    *&SPWIZARD: MODULE IT_MSEG_CHANGE_COL_ATTR.
       MODULE user_command_9001.
    +++++++++++++++++++++++++++++++++++
    Thanks,
    Vishal.

    Hi Aruna,
    Below is the code as you required.
    +++++++++++++++++++++++++++++
    MODULE user_command_9001 INPUT.
       ygp_header_mas-ret_type = v_gpt.
       CASE sy-ucomm.
         WHEN 'MBLNR'.
           PERFORM select_mblnr.
         WHEN 'DEL'.
           PERFORM select_delivery.
         WHEN 'INTI'.
           PERFORM grt_gi_details.
         WHEN 'GENT'.
           PERFORM get_ge_details.
         WHEN 'GP'.
           PERFORM get_returnable_gp.
         WHEN 'SAVE'.
           PERFORM gen_gp_number.
           PERFORM gen_data.
           PERFORM save_data.
         WHEN OTHERS.
           PERFORM get_ge_details_other.
           IF it_gp[] IS INITIAL.
             INSERT INITIAL LINE INTO it_gp INDEX 1.
           ENDIF.
       ENDCASE.
       IF v_entry = 07 .
         PERFORM serial_no1.
         PERFORM insert_row.
       ENDIF.
       IF sy-ucomm IS INITIAL.
         PERFORM calc_amt.
       ENDIF.
       CLEAR:sy-ucomm.
    ENDMODULE.                    "user_command_9001 INPUT
    +++++++++++++++++++++++++++++++
    MODULE it_mseg_user_command INPUT.
       ok_code = sy-ucomm.
       PERFORM user_ok_tc USING    'IT_MSEG'
                                   'IT_GP'
                                   'CHK'
                          CHANGING ok_code.
       sy-ucomm = ok_code.
    ENDMODULE.                    "IT_MSEG_USER_COMMAND INPUT
    ++++++++++++++++++++++++++++++++++
    MODULE it_mseg_modify INPUT.
       MODIFY it_gp
         FROM wa_gp
         INDEX it_mseg-current_line.
    ENDMODULE.                    "IT_MSEG_MODIFY INPUT    
    ====> Above module has some problem i think as while debugging it was not updating IT_GP as the current line number was not matching with IT_GP as it has only one line item and WA_GP was changing. Also WA_GP data was getting changed with LOOP with all line items data.
    ++++++++++++++++++++++++++++++++++++++++++++++
    MODULE it_mseg_mark INPUT.
       DATA: g_it_mseg_wa2 LIKE LINE OF it_gp.
       IF it_mseg-line_sel_mode = 1
       AND wa_gp-chk = 'X'.
         LOOP AT it_gp INTO g_it_mseg_wa2
           WHERE chk = 'X'.
           g_it_mseg_wa2-chk = ''.
           MODIFY it_gp
             FROM g_it_mseg_wa2
             TRANSPORTING chk.
         ENDLOOP.
       ENDIF.
       MODIFY it_gp
         FROM wa_gp
         INDEX it_mseg-current_line
         TRANSPORTING chk.
    ENDMODULE.                    "IT_MSEG_MARK INPUT
    +++++++++++++++++++++++++++++++++++++++++
    If I press ENTER after entering each line item, all records come in IT_GP but if not then only first line item comes. Also if I dont press ENTER after entering the first line item and and add one item (total 2) and then press ENTER then sometimes both the lines disappear.
    Thanks,
    Vishal

  • TEXT_IO ...  replace first line

    Hello,
    i have a small Problem with the TEXT_IO.PUT_LINE builtin
    I want to write and read a .txt file with TEXT_IO
    It workes fine but if i use put_line to write something in, it replace all inside my .txt file
    My Question: Is it possible to replace only the first line inside my txt file
    Example Forms:
    Declare
         filename           varchar2(30) := 't:\test\Laufzettel.txt';
         file_handle TEXT_IO.FILE_TYPE;
         umrechnung number;
    BEGIN
    If :parameter.intervall is not null then
         file_handle := TEXT_IO.FOPEN(filename, 'W');
         umrechnung := :button.intervall;
         umrechnung := round(((umrechnung*60)*1000));
         TEXT_IO.PUT_LINE(file_handle,umrechnung);     
         TEXT_IO.FCLOSE(file_handle);
    end if;
    END;
    and the .txt file looks like this:
    6000
    CT
    CT2
    Mammo
    MR
    US
    Bestrahlung
    MRT
    NUK
    SD
    i want to replace the 6000 with another number without rewriting all the other entrys?!
    Sorry for my bad English :)
    Message was edited by:
    user628271

    If you are unix use grep command to replace the string. And this grep command can be called using host.
    If you are in Windows , create a new file from the original and while creating you
    can replace which ever line you needed.
    Once you create the new file , delete the original file using host command.
    Once you delete the old file, copy the new file to the original file name using host command.
    Rajesh Alex

Maybe you are looking for

  • Get all invoices from the system and their details

    Hello Experts, Whats the most efficient FM to use for getting all the invoices in the system with details to transfer them to an external system? Should I get a list of all invoices and then call BBP_PD_INV_GETDETAIL on each? Thanks,

  • Apple ID's

    Here's a means to deal with the 2 Apple ID problem. It's not necessarily a solution; it's a message to Apple. Background: The old MobileMe, iTunes, and iCloud accounts do not get along. This is because iTunes used one Apple ID for purchases, and Mobi

  • DMS link with Material Bom

    Hi, all How can we link respective doc,s to  Bom Header and Bom item? I treid to attach some doc,s to above object,s the system messge is like,  "this transaction  is not support for this activity".  rgds ben

  • How can I print a contact sheet with a repeated row of images?

    Hi there, I am hoping that it is possible with my version of iPhoto to print a contact sheet on which I need to have a row of 8 pictures that then repeat down the entire page. I understand how to set the slider for the number of "rows" across the pag

  • System Hang up problem in CS-5 (5.0.0 and 5.02 both ver.)

    System Hang up problem in CS-5 (5.0.0 and 5.02 both ver.) I have HP machine with i 7 windows 7 and 8GB RAM. Here I'm pasting information from windows application errors: 09/24/2010 1:43PM Description A problem caused this program to stop interacting