Reading Multiple lines in a file Using File Adapter

Hi All,
Iam new to this technology.How to read multiple lines in a file using file adapter.Brief me with the methodology.

I didn't look at anything else but if you want to write more than one line ever to your file you should change this
out = new FileOutputStream("Calculation.log");to this...
out = new FileOutputStream("Calculation.log",true);A quick look at the API reveals the follow constructor FileOutputStream(File file, boolean append) append means should I add on the end of the file or over-write what is there.
By default you over-write. So in our case we say true instead which says add on to what is there.
At the end of that little snippet you shoudl be closing that stream as well.
So where you have
p.close();You should have
p.close();
out.close();

Similar Messages

  • How can I input read a line from a file and output it into the screen?

    How can I input read a line from a file and output it into the screen?
    If I have a file contains html code and I only want the URL, for example, www24.brinkster.com how can I read that into the buffer and write the output into the screen that using Java?
    Any help will be appreciate!
    ======START FILE default.html ========
    <html>
    <body>
    <br><br>
    <center>
    <font size=4 face=arial color=#336699>
    <b>Welcome to a DerekTran's Website!</b><br>
    Underconstructions.... <br>
    </font> </center>
    <font size=3 face=arial color=black> <br>
    Hello,<br>
    <br>
    I've been using the PWS to run the website on NT workstation 4.0. It was working
    fine. <br>
    The URL should be as below: <br>
    http://127.0.0.1/index.htm or http://localhost/index.htm
    <p>And suddently, it stops working, it can't find the connection. I tried to figure
    out what's going on, but still <font color="#FF0000">NO CLUES</font>. Does anyone
    know what's going on? Please see the link for more.... I believe that I setup
    everything correctly and the bugs still flying in the server.... <br>
    Thank you for your help.</P>
    </font>
    <p><font size=3 face=arial color=black>PeerWebServer.doc
    <br>
    <p><font size=3 face=arial color=black>CannotFindServer.doc
    <br>
    <p><font size=3 face=arial color=black>HOSTS file is not found
    <br>
    <p><font size=3 face=arial color=black>LMHOSTS file
    <br>
    <p><font size=3 face=arial color=black>How to Setup PWS on NT
    <BR>
    <p><font size=3 face=arial color=black>Issdmin doc</BR>
    Please be patient while the document is download....</font>
    <font size=3 face=arial color=black><br>If you have any ideas please drop me a
    few words at [email protected] </font><br>
    <br>
    <br>
    </p>
    <p><!--#include file="Hits.asp"--> </p>
    </body>
    </html>
    ========= END OF FILE ===============

    Hi!
    This is a possible solution to your problem.
    import java.io.*;
    class AddressExtractor {
         public static void main(String args[]) throws IOException{
              //retrieve the commandline parameters
              String fileName = "default.html";
              if (args.length != 0)      fileName =args[0];
               else {
                   System.out.println("Usage : java AddressExtractor <htmlfile>");
                   System.exit(0);
              BufferedReader in = new BufferedReader(new FileReader(new File(fileName)));
              StreamTokenizer st = new StreamTokenizer(in);
              st.lowerCaseMode(true);
              st.wordChars('/','/'); //include '/' chars as part of token
              st.wordChars(':',':'); //include ':' chars as part of token
              st.quoteChar('\"'); //set the " quote char
              int i;
              while (st.ttype != StreamTokenizer.TT_EOF) {
                   i = st.nextToken();
                   if (st.ttype == StreamTokenizer.TT_WORD) {          
                        if (st.sval.equals("href")) {               
                             i = st.nextToken(); //the next token (assumed) is the  '=' sign
                             i = st.nextToken(); //then after it is the href value.               
                             getURL(st.sval); //retrieve address
              in.close();
         static void getURL(String s) {     
              //Check string if it has http:// and truncate if it does
              if (s.indexOf("http://") >  -1) {
                   s = s.substring(s.indexOf("http://") + 7, s.length());
              //check if not mailto: do not print otherwise
              if (s.indexOf("mailto:") != -1) return;
              //printout anything after http:// and the next '/'
              //if no '/' then print all
                   if (s.indexOf('/') > -1) {
                        System.out.println(s.substring(0, s.indexOf('/')));
                   } else System.out.println(s);
    }Hope this helps. I used static methods instead of encapsulating everyting into a class.

  • How to read specific line in a file through UNIX shell script..

    Dear Friends,
    I have generated .ldt file under admin/import/US folder through FND_LOAD script for Download the responsibility.
    I registred Shell script (Host concurrent program) in Oracle apps. Now i want to read the file in speciific line which i was generated in admin/import/US folder through unix shell script. Please help me how to read specific line and the i want to replace that which i am going to read the specific line.
    Thanks in advance..
    Regards,
    Velu.

    Hi,
    Thanks for reply,
    My requirement i have to find the specific line in a file and find and replace needed word over there it's should happen programatically. i want to read specific line in a file Once complete find and replace the condition should exists. The loop will go to next file and read the same line in next file also do the same process upto how many files over there.i am doing through UNIX shell script. Please help me out to find the
    Your suggestion is highly appriciated.
    Thanks,
    Velu.

  • How to read multiple lines using 'REUSE_ALV_GRID_DISPLAY'

    Hi,
    In ALV report the FM 'REUSE_ALV_GRID_DISPLAY' used.
    EXPORTING
    I_CALLBACK_PROGRAM = W_REPID
    I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    How to read multiple lines in the following dynamic subroutine ?
    I am able to read single value through p_selfld.
    Nut the requirement is to change the values in more than 1 row for a fld (edit mode)
    FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
    P_SELFLD TYPE SLIS_SELFIELD.
    endform
    Thanks in advance

    You can get the reference by a dirty assign, but this is not offcially supported...
    But if you have some limitations.
    FORM user_command  USING fuw_ucomm LIKE sy-ucomm
                                       fuw_selfield TYPE slis_selfield.
      FIELD-SYMBOLS: <lfs_grid>  type ref to cl_gui_alv_grid,
                                   <lfs_row> type LVC_S_ROW.
      data: li_rows type lvc_t_row.
          assign ('(SAPLSLVC_FULLSCREEN)GT_GRID-GRID') to <lfs_grid>.
          check sy-subrc is initial.
          call method <lfs_grid>->get_selected_rows
            IMPORTING
              et_index_rows = li_rows.
    endform.                    "user_command

  • How to insert multiple line items in fv60 using bdc.

    Hi all,
          How to insert multiple line items in fv60 using bdcs

    hi
    chk this
    DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    DATA : IT_MESSAGES LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    DATA : V_EBELP(30) , V_MENGE(30) , V_WERKS(30), V_EMATN(30) ,
    V_PEINH(30).
    DATA : FILE TYPE STRING, V_MSG(100) , V_IND(2) TYPE N , FLAG VALUE 'X'.
    PARAMETERS: P_FILE(50) TYPE C DEFAULT 'C:\ME21_TEST'.
    DATA : BEGIN OF ITAB OCCURS 0,
            IND(02),
            LIFNR_001(010),
    data element: BSART
            BSART_002(004),
    data element: BEDAT
    data element: EKORG
            EKORG_004(004),
            EKGRP_006(003),
    data element: LPEIN
            LPEIN_005(001),
    data element: EMATNR
            EMATN_01_007(018),
    data element: EWERK
            WERKS_01_008(004),
    data element: EPEIN
            PEINH_01_009(006),
    data element: EWERK
           MENGE_01_013(017),
    data element: AUFEP
            EBELP_014(005),
    data element: AUFEP
         END OF ITAB.
    START-OF-SELECTION.
    FILE = P_FILE.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = FILE
        FILETYPE                      = 'ASC'
        HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      TABLES
        DATA_TAB                      = ITAB
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    SORT ITAB BY IND.
    START-OF-SELECTION.
    LOOP AT ITAB.
    REFRESH IT_MESSAGES.
    <b>V_IND = V_IND + 1.</b>
    <b>AT NEW IND.</b>
    <b>READ TABLE ITAB INDEX SY-TABIX.</b>
    PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0100'.
    PERFORM BDC_FIELD       USING 'EKKO-LIFNR'
                                  ITAB-LIFNR_001.
    PERFORM BDC_FIELD       USING 'RM06E-BSART'
                                  ITAB-BSART_002.
    *perform bdc_field       using 'RM06E-BEDAT'
                                 ITAB-BEDAT_003.
    PERFORM BDC_FIELD       USING 'EKKO-EKORG'
                                  ITAB-EKORG_004.
    PERFORM BDC_FIELD       USING 'RM06E-LPEIN'
                                  ITAB-LPEIN_005.
    PERFORM BDC_FIELD       USING 'EKKO-EKGRP'
                                  ITAB-EKGRP_006.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    ENDAT.
    <b>PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0120'.
    CONCATENATE 'EKPO-EMATN(' V_IND ')' INTO V_EMATN.
    PERFORM BDC_FIELD       USING  V_EMATN
                                   ITAB-EMATN_01_007.
    CONCATENATE 'EKPO-WERKS(' V_IND ')' INTO V_WERKS.
    PERFORM BDC_FIELD       USING  V_WERKS
                                   ITAB-WERKS_01_008.
    CONCATENATE 'EKPO-PEINH(' V_IND ')' INTO V_PEINH.
    PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0120'.
    PERFORM BDC_FIELD       USING  V_PEINH
                                   ITAB-PEINH_01_009.
    *CONCATENATE 'EKPO-MENGE(' V_IND ')' INTO V_MENGE.
    *perform bdc_dynpro      using 'SAPMM06E' '0120'.
    *perform bdc_field       using  V_MENGE
                                  ITAB-MENGE_01_013.
    *CONCATENATE 'EKPO-EBELP(' V_IND ')' INTO V_EBELP.
    PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0120'.
    PERFORM BDC_FIELD       USING  'RM06E-EBELP'
                                   ITAB-EBELP_014.</b>PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    AT END OF IND.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '=BU'.
    ENDAT.
    CALL TRANSACTION 'ME21' USING IT_BDCDATA MODE 'A'
                                             UPDATE 'S'
                                        MESSAGES INTO IT_MESSAGES.
       LOOP AT IT_MESSAGES WHERE MSGTYP = 'E' OR MSGTYP = 'A'.
         IF FLAG = 'X'.
         CALL FUNCTION 'BDC_OPEN_GROUP'
         EXPORTING
            CLIENT                    = SY-MANDT
           DEST                      = FILLER8
            GROUP                     = 'GAMY_FAILURE'
           HOLDDATE                  = FILLER8
            KEEP                      = 'X'
            USER                      = SY-UNAME
           RECORD                    = FILLER1
           PROG                      = SY-CPROG
         IMPORTING
           QID                       =
          EXCEPTIONS
            CLIENT_INVALID            = 1
            DESTINATION_INVALID       = 2
            GROUP_INVALID             = 3
            GROUP_IS_LOCKED           = 4
            HOLDDATE_INVALID          = 5
            INTERNAL_ERROR            = 6
            QUEUE_ERROR               = 7
            RUNNING                   = 8
            SYSTEM_LOCK_ERROR         = 9
            USER_INVALID              = 10
            OTHERS                    = 11
         IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
         CLEAR FLAG.
         ENDIF.
         CALL FUNCTION 'BDC_INSERT'
          EXPORTING
            TCODE                  = 'ME21'
           POST_LOCAL             = NOVBLOCAL
           PRINTING               = NOPRINT
           SIMUBATCH              = ' '
           CTUPARAMS              = ' '
           TABLES
             DYNPROTAB              = IT_BDCDATA
          EXCEPTIONS
            INTERNAL_ERROR         = 1
            NOT_OPEN               = 2
            QUEUE_ERROR            = 3
            TCODE_INVALID          = 4
            PRINTING_INVALID       = 5
            POSTING_INVALID        = 6
            OTHERS                 = 7
         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.
    CALL FUNCTION 'FORMAT_MESSAGE'
      EXPORTING
        ID              = IT_MESSAGES-MSGID
        LANG            = 'EN'
        NO              = IT_MESSAGES-MSGNR
        V1              = IT_MESSAGES-MSGV1
        V2              = IT_MESSAGES-MSGV2
        V3              = IT_MESSAGES-MSGV3
        V4              = IT_MESSAGES-MSGV4
      IMPORTING
        MSG             = V_MSG
      EXCEPTIONS
        NOT_FOUND       = 1
        OTHERS          = 2
       WRITE : / V_MSG.
    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.
       ENDLOOP.
    IF FLAG NE 'X'.
      CALL FUNCTION 'BDC_CLOSE_GROUP'
       EXCEPTIONS
         NOT_OPEN          = 1
         QUEUE_ERROR       = 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.
      ENDIF.
           Start new screen                                              *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR IT_BDCDATA.
      IT_BDCDATA-PROGRAM  = PROGRAM.
      IT_BDCDATA-DYNPRO   = DYNPRO.
      IT_BDCDATA-DYNBEGIN = 'X'.
      APPEND IT_BDCDATA.
    ENDFORM.
           Insert field                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
        CLEAR IT_BDCDATA.
        IT_BDCDATA-FNAM = FNAM.
        IT_BDCDATA-FVAL = FVAL.
        APPEND IT_BDCDATA.

  • Command Line Parameter in File Adapter in SAP PI

    Hi
    Can any body explaine me what is the purpose of 'Command Line' parameter in File Adapter (Sender/Receiver).
    Regards,

    Hi,
    Refer below two links for more help!
    SAP XI File Adapter OS Command Line Feature     
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/sapXIFileAdapterOSCommandLine+Feature
    More with the File Adapter      
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/morewiththeFileAdapter
    Regards,
    Jilan

  • StringTokenizer to read multiple lines

    I've been struggling to make my program to read multiple lines from the input text
    input5.txt:
    -.1 -2.3 -45.678 -90
    .1 .23 .45678 .90
    1 2.3 4.56
    0
    and the program will stop reading when it sees 0 in the line. What i got was a nullPointerException, it reads a single line fine, but when it comes to multiple lines, it messes up. Heres a portion of my program code:
    while (info1 != null && !end)
         tokenizer = new StringTokenizer(info1, " \t\r\n");
         while ((info1 = stdin.readLine()) != null && info1.length() != 0)
              if (tokenizer.hasMoreTokens())
                   // temp is a dummy String to help for counting limit.
                   temp = tokenizer.nextToken();
                   dummy [limit] = temp;
                   limit++;
         numbers = new float [limit];
         while (count < limit)
              while (tokenizer2.hasMoreTokens() && num1 != 0.0 && num1 != 0)
                   num1 = Float.parseFloat(dummy[count]);
                   numbers[count] = num1;
                   count++;
         end = true;
    }

    You need to move the "new StringTokenizer" into the following while loop
    John

  • 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

  • How to handle multiple threads to read one line from a file each time?

    Dear Sir or Madam,
    I'm new to multiple threads java programming. What I want to do is as following:
    1. I'm writing a program to read one line of text from a very large file, and then do some process on this one line of text, then read the next line of text from this file, then process on this line of text, ...... When reach the end of the file, close the file.
    This is a single thread scenario.
    2. To fullly untilized computer resource, I want to create multiple threads to process this large file.
    One thing is very important is that each line of text in the large file has to be read sequentially. This means that the first line of text in the large file is read first, then the second line, then the third line ......
    My question is that if I create multiple threads to process the same file, how can I make sure that different threads will read the line of text from the same file sequentially?
    I don't have enough experience on java multiple threads programming, so it will be very appreaciated if you can help me on this as soon as you are available.
    Thanks and regards,
    Steven Wu

    A better solutoin would be to have a single thread that reads each line an puts it into a queue, and then multiple threads reading from the queue to process these lines.
    This will only be effective if the amount of processing to be done on each line is very large compared to how long it takes to read the line, or if you have more than one CPU on your machine.

  • How to read multiple lines from an external file to the Oracle data base

    Hi Guys,
    I have an external file which contains multiple lines and I want to read it to the data base .I have done it for the file if it contains one line.
    Please guide me how to retrieve all the lines into the data base.And also tell me how Oracle will come to know the end of the line in the file
    Thanks,
    Prafulla

    Hi,
    try this
    CREATE TABLE ab
    a VARCHAR2(1 BYTE),
    b VARCHAR2(2 BYTE),
    c VARCHAR2(10 BYTE),
    d VARCHAR2(11 BYTE)
    ORGANIZATION EXTERNAL
    ( TYPE ORACLE_LOADER
    DEFAULT DIRECTORY dir_name
    ACCESS PARAMETERS
    ( records delimited by newline
    fields (
    a POSITION(*) CHAR(1),
    b POSITION(*) CHAR(2 ),
    c POSITION(*) CHAR(10 ),
    d POSITION(*) CHAR(11 )
    LOCATION (dir_name:'filename.txt')
    REJECT LIMIT UNLIMITED
    NOPARALLEL
    NOMONITORING;
    Regards,
    Simma....

  • Multiple Header line in Receiver File adapter

    Hi,
    I have an issue in Receiver File adapter with multiple header lines. I am able to get only 1 header lines in the receiver file but not multiple header lines with 'nl' since it is static in file mode
    [CommunityTag:Header]
    empNo,EmpName,Age
    [CommunityTag]
    I tried with the below in content conversion one as below with no luck
    Root.addHeaderLine=1
    Root.headerLine=[CommunityTag:Header] 'nl' empNo,EmpName,Age 'nl' [CommunityTag]
    Root.fiedSeparator=,
    Root.endSeparator='nl'
    I am getting the Header line as same row as static text.
    Can you advise this.

    Hi Gabriel, I suggest to produce the header lines from additional nodes in the message payload. That means you need to modify the data type of the target message in order to generate an extra structure in the payload. Use constants in message mapping to generate the header column names, e.g.
    <Header>
      <H1>CommunityTag:Header</H1>
      <H2>empNo,EmpName,Age</H2>
      <H3>CommunityTag</H3>
    </Header>
    In content conversion you have to convert the Header row with
    Header.endSeparator='nl'
    You won't need parameter addHeaderLine anymore then.
    Regards, Martin

  • Pass Idoc PO Multiple Line Items to file

    Hello All,
    we are using Message Type ORDERS and ORDERS1 as Basic type to pass PO and sales data. I have configured IDOC to File scenario. I'm able to successfully place a file in file folder.
    But my issue is some of the PO's have multiple line items and saved file has one first line item information. I have even tried unbounded for line item but no luck.
    <b>How do I pass all the line item values to the file ?.</b>
    The output structure should be
    1. PO Number
    2. PO ITem
    3. Material No
    4. Delivery Date
    5. Vendor Number
    the data type I created is
    Pur_Ord
    |__ EBELN
    |__ EBELP  0..Unbounded
    |__ MATNR
    |__ AEDAT
    |__ LIFNR
    the current output is
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Pur_Ord_Out xmlns:ns0="http://PO_TO_FILE">
      <EBELN>0004500066</EBELN>
      <EBELP>00001</EBELP>
      <MATNR>000000000000010027</MATNR>
      <AEDAT>20051215</AEDAT>
      <LIFNR>0001005780</LIFNR>
    </ns0:Pur_Ord_Out>
    Im looking for an output with all line items
    Thanks in advance
    Praveen

    Praveen
    Try this
    Pur_Ord
    |__ ORDERS 0.. Unbounded
      |__ EBELN
      |__ EBELP
      |__ MATNR
      |__ AEDAT
      |__ LIFNR
    Here ORDERS is the parent node.
    KK
    Message was edited by: KK

  • Problem while reading a line from a file

    Hi all
    I am facing a problem while readinga line from a file ,
    line contains some french characters due to which it skips sequence, returning invalid record in a variable
    e.g 'abcdefghÛLasasa'
    Starting Point of Û is 9 and if
    V1:=substr(''abcdefghÛLasasa',9,3)
    result is v1='ÛLas' which is invalid
    can i anybody help me out in resolving this problem

    Hello,
    What is your oracle version? And what is your expected result.
    I used the same string and this is my output on 10.2.
    select substr('abcdefghÛLasasa',9,3) mystring from dual;
    MYS
    ÛLa
    1 row selected.Regards
    Edited by: OrionNet on Jan 29, 2009 12:45 AM

  • Script or command line to comment out multiple lines in flat files

    I am looking for a way to go through multiple flat files within the same directory for the occurance of a server name and if found to insert a comment (#) at the beginning of the line. Currently, I am grepping for the server name within the directory and then doing a vi on each individual flat file to comment out the line. The server name is separated by the pipe (|) symbol and each line of every file is in this format:
    webservers:WEBSERVER|Env Name|servername|application name
    So, in the above, I am grepping for the servername part and if found in there, I want to change the line to:
    #webservers:WEBSERVER|Env Name|servername|application name
    I would think there would be a way of doing this either with command line Perl or with maybe awk or sed. Any suggestions would be greatly appreciated.

    You could do something like this with a ksh shell script:
    #!/usr/bin/ksh
    for file in `ls`; do
            echo $file
            sed 's/^webserver/#webserver/g' $file > $file.parsed; mv $file.parsed $file
    doneThis will go through everyfile in the directory and search for "start of line" webserver and replace it with "#webserver". Then the file will get move back to the original file name.
    If you just want to change certain files ie. only filenames with the word "server" in it, then change:
    for file in `ls`; do to something like
    for file in `ls *server*`; doHope this help...
    Cheers
    pdaemon

  • Reading multiple messages from XML file.

    Hi, I have such XML file:
    <?xml version="1.0" encoding="UTF-8"?>
    <dataroot xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:SchemaLocation="xml_table.xsd" generated="2007-09-30T17:40:55">
    <xml_table>
    <id>1</id>
    <name>Pablik</name>
    <phone>7777777</phone>
    </xml_table>
    <xml_table>
    <id>2</id>
    <name>SomeName</name>
    <phone>2929292</phone>
    </xml_table>
    </dataroot>
    I have past this file through file adapter (using schema definition etc). I can read content of file:
    ora:getContentAsString(bpws:getVariableData('XMLType','dataroot'))
    But I can’t get xml element value, for example name... :
    bpws:getVariableData('XMLType','dataroot','/ns15:dataroot/ns15:xml_table/ns15:name')
    Error: com.oracle.bpel.client.delivery.ReceiveTimeOutException: Waiting for response has timed out. The conversation id is 16d59568a10954ee:-4254ad7e:11580ba6d96:-7f38. Please check the process instance for detail.
    bpws:getVariableData('XMLType','dataroot','/ns15:dataroot/ns15:xml_table[0]/ns15:name')
    Error: com.oracle.bpel.client.delivery.ReceiveTimeOutException: Waiting for response has timed out. The conversation id is 16d59568a10954ee:-4254ad7e:11580ba6d96:-7f3f. Please check the process instance for detail.
    ora:getNodeValue(bpws:getVariableData('XMLType','dataroot','/ns15:dataroot/ns15:xml_table/ns15:name'))     
    Result: oracle.xml.parser.v2.XMLNodeList@1aa98f1
    ora:getNodeValue(bpws:getVariableData('XMLType','dataroot','/ns15:dataroot/ns15:xml_table[0]/ns15:name'))
    Result: oracle.xml.parser.v2.XMLNodeList@14cb6a0
    Etc.
    How can I get value through assign method?

    It looks to me that your XML data does not have a default namespace.
    You defined namespace "ns15" in your bpel process.
    Are you able to set the default name space in your xml data.
    Marc
    http://orasoa.blogspot.com

Maybe you are looking for