LSMW Convert Excel to Tab Delimited

Hello,
I need to upload data, presnt in excel sheet via LSMW. The input for the LSMW needs to be in tab delimited file. Is it possible in the LSMW process to be able to convert the file format from excel to a tab delimited file or should the file format be manually changed to excel ?
Thanks,
Anand

Thanks for the answer..But I wanted to know if the same operation can be automated or is it possible via LSMW ? Can we achieve this in any of the steps in LSMW ?
Regards,
Anand

Similar Messages

  • Converting Excel to Tab Delimited

    hello all,
    I need to write a program in ABAP that will take in Excel file and convert it to a Tab Delimited file.
    How can I go about doing that?
    Thanks in advance.
    Regards,
    Fred.

    Hi Fread,
    1. Take the Excel Data into an internal table. Refer the code below.
    REPORT zexceltabc.
    PARAMETERS: filename LIKE rlgrap-filename,
                begcol TYPE i DEFAULT 1 NO-DISPLAY,
                begrow TYPE i DEFAULT 1 NO-DISPLAY,
                endcol TYPE i DEFAULT 100 NO-DISPLAY,
                endrow TYPE i DEFAULT 32000 NO-DISPLAY.
    PARAMETERS: kzheader AS CHECKBOX.
    DATA: BEGIN OF intern OCCURS 0.
            INCLUDE STRUCTURE  alsmex_tabline.
    DATA: END OF intern.
    DATA: BEGIN OF intern1 OCCURS 0.
            INCLUDE STRUCTURE  alsmex_tabline.
    DATA: END OF intern1.
    DATA: BEGIN OF t_col OCCURS 0,
           col LIKE alsmex_tabline-col,
           size TYPE i.
    DATA: END OF t_col.
    DATA: zwlen TYPE i,
          zwlines TYPE i.
    DATA: BEGIN OF fieldnames OCCURS 3,
            title(60),
            table(6),
            field(10),
            kz(1),
          END OF fieldnames.
    DATA: BEGIN OF data_tab OCCURS 0,
           value_0001(50),
           value_0002(50),
           value_0003(50),
           value_0004(50),
           value_0005(50),
           value_0006(50),
           value_0007(50),
           value_0008(50),
           value_0009(50),
           value_0010(50),
           value_0011(50),
           value_0012(50),
           value_0013(50),
           value_0014(50),
           value_0015(50),
           value_0016(50),
           value_0017(50),
           value_0018(50),
           value_0019(50),
           value_0020(50),
           value_0021(50),
           value_0022(50),
           value_0023(50),
           value_0024(50),
           value_0025(50),
           value_0026(50),
           value_0027(50),
           value_0028(50),
           value_0029(50),
           value_0030(50),
           value_0031(50),
           value_0032(50),
           value_0033(50),
           value_0034(50),
           value_0035(50),
           value_0036(50),
           value_0037(50),
           value_0038(50),
           value_0039(50),
           value_0040(50),
           value_0041(50),
           value_0042(50),
           value_0043(50),
           value_0044(50),
           value_0045(50),
           value_0046(50),
           value_0047(50),
           value_0048(50),
           value_0049(50),
           value_0050(50),
           value_0051(50),
           value_0052(50),
           value_0053(50),
           value_0054(50),
           value_0055(50),
           value_0056(50),
           value_0057(50),
           value_0058(50),
           value_0059(50),
           value_0060(50),
           value_0061(50),
           value_0062(50),
           value_0063(50),
           value_0064(50),
           value_0065(50),
           value_0066(50),
           value_0067(50),
           value_0068(50),
           value_0069(50),
           value_0070(50),
           value_0071(50),
           value_0072(50),
           value_0073(50),
           value_0074(50),
           value_0075(50),
           value_0076(50),
           value_0077(50),
           value_0078(50),
           value_0079(50),
           value_0080(50),
           value_0081(50),
           value_0082(50),
           value_0083(50),
           value_0084(50),
           value_0085(50),
           value_0086(50),
           value_0087(50),
           value_0088(50),
           value_0089(50),
           value_0090(50),
           value_0091(50),
           value_0092(50),
           value_0093(50),
           value_0094(50),
           value_0095(50),
           value_0096(50),
           value_0097(50),
           value_0098(50),
           value_0099(50),
           value_0100(50).
    DATA: END OF data_tab.
    DATA: tind(4) TYPE n.
    DATA: zwfeld(19).
    FIELD-SYMBOLS:  0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    END-OF-SELECTION.
    max. Feldlänge je Spalte ermitteln...
      LOOP AT intern.
        intern1 = intern.
        CLEAR intern1-row.
        APPEND intern1.
      ENDLOOP.
      SORT intern1 BY col.
      LOOP AT intern1.
        AT NEW col.
          t_col-col = intern1-col.
          APPEND t_col.
        ENDAT.
        zwlen = strlen( intern1-value ).
        READ TABLE t_col WITH KEY col = intern1-col.
        IF sy-subrc EQ 0.
          IF zwlen > t_col-size.
            t_col-size = zwlen.
            MODIFY t_col INDEX sy-tabix.
          ENDIF.
        ENDIF.
      ENDLOOP.
    max. Spaltenanzahl ermitteln.
      DESCRIBE TABLE t_col LINES zwlines.
    wenn die 1. Zeile die Spaltenüberschriften enthält...
      SORT intern BY row col.
      IF kzheader = 'X'.
        LOOP AT intern.
          fieldnames-title = intern-value.
          APPEND fieldnames.
          AT END OF row.                  " Ende der 1. Zeile
            EXIT.
          ENDAT.
        ENDLOOP.
      ELSE.
        DO zwlines TIMES.
          WRITE sy-index TO fieldnames-title.
          APPEND fieldnames.
        ENDDO.
      ENDIF.
    Data_tab füllen ...
      SORT intern BY row col.
      LOOP AT intern.
        IF kzheader = 'X'
        AND intern-row = 1.
          CONTINUE.
        ENDIF.
        tind = intern-col.
        CONCATENATE 'DATA_TAB-VALUE_' tind INTO zwfeld.
        ASSIGN (zwfeld) TO  = intern-value.
        AT END OF row.
          APPEND data_tab.
          CLEAR data_tab.
        ENDAT.
      ENDLOOP.
      CALL FUNCTION 'DISPLAY_BASIC_LIST'
           EXPORTING
                file_name     = filename
           TABLES
                data_tab      = data_tab
                fieldname_tab = fieldnames.
    2. Then use this internal table and write the data to a file.
    Hope this helps.
    Regards,
    Amit Mishra

  • Excel to Tab delimited .text

    At work i have to deal with a lot of excels in which i have to save the file as .txt and then .xls, I will then upload the .txt file to SAP
    In the txt files, the numbers are being saved with "." (dot) and not with a ","(Comma) in the decimals, even though then numbers in excel are formated in number with 2 decimals and with comma separator.
    So I'm having problems with this, I've tried the different formats (number, text, general) but nothing seems to work. If I save manually in Tab delimited .txt the files is always saved with a comma in the decimals, but if i run the excel macro the .txt always save with a dot. I've also tried changing the file format in my VBA (TextWindows, TextMSDOS, Currentplatformtext) without sucess.
    Can anyone give me some help with this? I've been looking the internet for a solution but found none. The number of files i have to upload is huge, so i'd like to program my macro to do all this saving automatically.
    Thank you..
    PS:The VBA code I am using now is this:
    Sub Save()
        Dim NomeFicheiro As String
        Dim PathGrav As String
        NomeFicheiro = InputBox("Nome do Ficheiro?")
        PathGrav = "H:\Starflows\" & NomeFicheiro
        If NomeFicheiro = "" Then Exit Sub
        ActiveWorkbook.SaveAs Filename:=PathGrav, FileFormat:=xlTextWindows, CreateBackup:=False
        ActiveWorkbook.SaveAs Filename:=PathGrav, FileFormat:=xlNormal, CreateBackup:=False
        ActiveWorkbook.Close SaveChanges:=False
    End Sub

    I thought it might me the regional settings, mine are in Portuguese and by default we have the comma as decimal separator, so this should be ok.
    I tried changing to the English (US) format using both the comma and the dot as separator, but the problem remains, the macro is always saved with dot instead of comma, even so if I save the file manually as tab delimited text.
    What I also did was, I configured dot as decimal separator in the regional settings and putted commas in the numbers in my excel, I think it recognizes the numbers as text, in this case, when i run the macro the numbers in the text are saved with quotes like this but with commas, for example  "12,56". But in this case SAP does not accept the file because of the quotes.
    I remembered something that might be the reason for this happening. when I manually save as tab delimited .txt, excel asks me 2 questions, which i answer yes and which could be important.
    1. Excel tells me that the selected file type does not support workbooks that contain multiple sheets and to save only the active sheet click ok. This does not look like the problem but i changed the code to:
    ActiveSheet.SaveAs Filename:=PathGrav, FileFormat:=xlTextWindows, CreateBackup:=False
    I executed it but the dot and not comma remains.
    2. 123.txt may contain features that are not compatible with Text (Tab delimited). Do you want to keep the workbook in this format?
    *To keep this format, which leaves out any incompatible features, click Yes.
    *To preserve the features, click No. then save a copy in the latest Excel format
    I press yes and the file is saved as comma delimited.
    Could it be that i need to add something to my VBA code, as when the macro runs I am not prompted any of these questions.
    Thanks

  • EXcel to tab delimited text file

    I am saving an excel file into a tab delimited text file so that i can use it for uploading data.
    The excel file contains a text field in which there is a comma ',' .
    for all the fields which has a comma in the excel file
    the text  file is adding double qoutes " in the beginning and end of the filed.
    for example
    contents of filed in excel file is :  GASKET, FLAT OEM 1380X1530X3 SIL ARAMIDE
    and in the text file it is coming as "GASKET, FLAT OEM 1380X1530X3 SIL ARAMIDE"
    i dont want the " in the beginning and end
    can anybody help.
    points will be rewarded.
    I am just saving the excel file as tab delimited text file and i am getting the quotes added in the begining and end.
    Thanks.

    Thats to preserer the comma in between otherwise when you upload the same the data will split at comma.
    Regards,
    Amit
    Reward all helpful replies.

  • Date is not show up in correct format from excel with tab-delimited was generated from query

    Hi,
    My code below worked file and save file into txt file.  However, the date is the problem.  I have to open excel file and manulay change the format of the date to make it shows the correct date, other way, it alutomatic shows 00:00:00 when i first open the file.  How can i make the date automatic shows from the file i generated in excel?
    <cfset tab = chr(9)>
    <cfset Str = "">
    <cfloop query="q_report">
    <cfset Str = Str & q_report.purchasedNo & tab & q_report.desc & tab & q_report.Del_date & chr(13) & chr(10)>
    </cfloop>
    <cffile action="write" output="#Str#" file="#variables.file#">
    thanks

    Have you tried using DateFormat() on the date?
    ^_^

  • Issue related to Excel to Text tab delimited conversion

    Hi,
    I am facing a strange issue in converting an excel file to a text tab delimited file. I have an excel sheet which contains two columns:
    vendor         new_zip
    153357      99645-6340
    162642         99669-7631
    $209930-1   91320-1201
    $209989-1   91710-5766
    When i save this file as a text tab delimited file  this is how it turns into:
        vendor  new_zip
        153357  99645-6340
        162642  99669-7631
        $209930-1     91320-1201
        $209989-1     91710-5766
    i am using WS_UPLOAD since i am not using the enterprise version of SAP. In the above mentioned u can see that the zip values(first character) of the first two records and the vendor numbers(last character) of the last two records get in line with each other. so when i load this file it gives a "File open error" exception. if i move the zip codes of the first two records by one space so that they are not in line with the vendor numbers of the last two records the file uploading happens fine. but this is something which cant be done from the user point of view. so can anyone tell as to what can be done without changing the concept of using text tab delimited file and aviod this problem?
    thanks & regards,
    Bala.

    The following program uses alsm_convert_excel_to_internal_table.but i want to use split at tab delimiter.pls help.
    REPORT ZSAINAL_BDC_TRAN .
    *INCLUDE BDCRECX1.
    *definition of selection screen
    SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME .
    SELECTION-SCREEN BEGIN OF BLOCK bl2 WITH FRAME TITLE text-t01.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 10(20) text-c01.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 10(10) text-c02.
    SELECTION-SCREEN POSITION 22.
    PARAMETERS: p_txt RADIOBUTTON GROUP grp1 DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 30(12) text-c03.
    SELECTION-SCREEN POSITION 46.
    PARAMETERS: p_xls RADIOBUTTON GROUP grp1 .
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN END OF BLOCK bl2.
    *PARAMETERS
    PARAMETERS ctumode LIKE ctu_params-dismode DEFAULT 'A'.
    PARAMETERS cupdate LIKE ctu_params-updmode DEFAULT 'S'.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN END OF BLOCK bl1.
    *DATA
    DATA : bdc_data LIKE STANDARD TABLE OF bdcdata INITIAL SIZE 10
           WITH HEADER LINE.
    *DATA: bdc_tab LIKE TABLE OF bdcdata INITIAL SIZE 0 WITH HEADER LINE.
    *Internal table to get legacy data records structured in
    *target format
    DATA: BEGIN OF inrec OCCURS 0,
              lifnr LIKE lfa1-lifnr,
              name1 LIKE lfa1-name1,
              stras LIKE lfa1-stras,
              ort01 LIKE lfa1-ort01,
          END OF inrec.
    *Internal table of structure ALSMEX_TABLINE suitable for
    *uploading records from an Excel worksheet
    DATA: it_excel TYPE STANDARD TABLE OF alsmex_tabline
                  INITIAL SIZE 0 WITH HEADER LINE,
          it_excel_dummy TYPE  alsmex_tabline.
    data: messtab like bdcmsgcoll occurs 0 with header line.
    DATA: L_MSTRING(480).
    DATA: L_SUBRC LIKE SY-SUBRC.
    *START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM read_data.
      PERFORM populate_bdcdata.
    *START NEW SCREEN
    FORM bdc_dynpro USING program dynpro.
      CLEAR bdc_data.
      bdc_data-program  = program.
      bdc_data-dynpro   = dynpro.
      bdc_data-dynbegin = 'X'.
      APPEND bdc_data.
    ENDFORM.
    *INSERT FIELD
    FORM bdc_field USING fnam fval.
    IF FVAL <> NODATA.
      CLEAR bdc_data.
      bdc_data-fnam = fnam.
      bdc_data-fval = fval.
      APPEND bdc_data.
    ENDIF.
    ENDFORM.
    *&      Form  read_data
          text
    -->  p1        text
    <--  p2        text
    FORM read_data.
      IF p_txt = 'X'.
        CALL FUNCTION 'GUI_UPLOAD'
            EXPORTING
              filename                      = 'C:\URMILA.TXT'
             filetype                      = 'ASC'
             has_field_separator           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
            TABLES
              data_tab                      = inrec
       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.
          WRITE: /'ERROR UPLOADING TXT FILE FROM PRESENTATION SERVER!',
                 / 'RETURN CODE : ',sy-subrc.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ELSE.  "filetype is excel
    -read excel file into an int. table in row/col format--
        CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
             EXPORTING
                  filename                = 'C:\URMILA.XLS'
                  i_begin_col             = 1
                  i_begin_row             = 1
                  i_end_col               = 4
                  i_end_row               = 3
             TABLES
                  intern                  = it_excel
             EXCEPTIONS
                  inconsistent_parameters = 1
                  upload_ole              = 2
                  OTHERS                  = 3.
        IF sy-subrc <> 0.
          WRITE: /'ERROR UPLOADING XLS FILE FROM PRESENTATION SERVER!',
                 / 'RETURN CODE : ',sy-subrc.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ELSE.
    --now fill data from it_excel into final legacy data itabinrec----
          IF NOT it_excel[] IS INITIAL.
            CLEAR inrec.
            REFRESH inrec[].
            LOOP AT it_excel.
              it_excel_dummy = it_excel.
              AT NEW col.
                CASE it_excel_dummy-col.
                  WHEN 1.
                    inrec-lifnr = it_excel_dummy-value(10).
                  WHEN 2.
                    inrec-name1 = it_excel_dummy-value(35).
                  WHEN 3.
                    inrec-stras = it_excel_dummy-value(35).
                  WHEN 4.
                    inrec-ort01 = it_excel_dummy-value(35).
                    APPEND inrec.
                    CLEAR inrec.
                ENDCASE.
              ENDAT.
             AT END OF row.
             ENDAT.
            ENDLOOP.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.
    *&      Form  populate_bdcdata
      to populate BDCDATA table from legacy file data contained in
      internal table inrec.
    -->  p1        text
    <--  p2        text
    FORM populate_bdcdata.
      IF  not inrec[] IS INITIAL.
        LOOP AT inrec.
          CLEAR bdc_data.
          REFRESH bdc_data.
          PERFORM bdc_dynpro      USING 'SAPMF02K' '0106'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
          PERFORM bdc_field       USING 'RF02K-LIFNR'
                                        inrec-lifnr.
          PERFORM bdc_field       USING 'RF02K-BUKRS'
                                        '1000'.
          PERFORM bdc_field       USING 'RF02K-D0110'
                                        'X'.
          PERFORM bdc_dynpro      USING 'SAPMF02K' '0110'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=PF03'.
          PERFORM bdc_field       USING 'LFA1-NAME1'
                                       inrec-name1.
          PERFORM bdc_field       USING 'LFA1-SORTL'
                                        'ALLGEMEIN'.
          PERFORM bdc_field       USING 'LFA1-STRAS'
                                        inrec-stras.
          PERFORM bdc_field       USING 'LFA1-PFACH'
                                        '645793'.
          PERFORM bdc_field       USING 'LFA1-ORT01'
                                        inrec-ort01.
          PERFORM bdc_field       USING 'LFA1-PSTLZ'
                                        '12001'.
          PERFORM bdc_field       USING 'LFA1-ORT02'
                                        'COOK'.
          PERFORM bdc_field       USING 'LFA1-PSTL2'
                                        '76905'.
          PERFORM bdc_field       USING 'LFA1-LAND1'
                                        'DE'.
          PERFORM bdc_field       USING 'LFA1-REGIO'
                                        '11'.
          PERFORM bdc_field       USING 'LFA1-SPRAS'
                                        'DE'.
          PERFORM bdc_field       USING 'LFA1-TELF1'
                                        '06894/55501-0'.
          PERFORM bdc_field       USING 'LFA1-TELFX'
                                        '06894/55501-100'.
          PERFORM bdc_dynpro      USING 'SAPLSPO1' '0100'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=YES'.
          CALL TRANSACTION 'FK02'
                           USING bdc_data
                           MODE ctumode
                           UPDATE cupdate
                           MESSAGES INTO MESSTAB.
        ENDLOOP.
        perform mess_handling.
      ENDIF.
    ENDFORM.                    " populate_bdcdata
    *&      Form  mess_handling
          ERROR MESSAGE HANDLING IN CALL TRANACTION
    -->  p1        text
    <--  p2        text
    form mess_handling.
    tables:T100.
    LOOP AT MESSTAB.
            SELECT SINGLE * FROM T100 WHERE SPRSL = MESSTAB-MSGSPRA
                                      AND   ARBGB = MESSTAB-MSGID
                                      AND   MSGNR = MESSTAB-MSGNR.
            IF SY-SUBRC = 0.
              L_MSTRING = T100-TEXT.
              IF L_MSTRING CS '&1'.
                REPLACE '&1' WITH MESSTAB-MSGV1 INTO L_MSTRING.
                REPLACE '&2' WITH MESSTAB-MSGV2 INTO L_MSTRING.
                REPLACE '&3' WITH MESSTAB-MSGV3 INTO L_MSTRING.
                REPLACE '&4' WITH MESSTAB-MSGV4 INTO L_MSTRING.
              ELSE.
                REPLACE '&' WITH MESSTAB-MSGV1 INTO L_MSTRING.
                REPLACE '&' WITH MESSTAB-MSGV2 INTO L_MSTRING.
                REPLACE '&' WITH MESSTAB-MSGV3 INTO L_MSTRING.
                REPLACE '&' WITH MESSTAB-MSGV4 INTO L_MSTRING.
              ENDIF.
              CONDENSE L_MSTRING.
              WRITE: / MESSTAB-MSGTYP, L_MSTRING(250).
            ELSE.
              WRITE: / MESSTAB.
            ENDIF.
          ENDLOOP.
    endform.                    " mess_handling

  • Function module to convert an internal table to an tab delimited XL file

    hi everyone
    can anyone tell me the name of the function module which can convert the data in the internal table to an Excel file (Tab de-limited).
    vamsi

    Hello Vamsi
    Just in case you need functions for the other way around (e.g. .csv-file -> internal table) SAP provides the following function modules:
    - TEXT_CONVERT_CSV_TO_SAP
    - SAP_CONVERT_TO_CSV_FORMAT
    This function group <b>TRUX </b>contains some more interesting function modules.
    Regards
      Uwe

  • How to convert Mail attachment file Tab Delimited file to XML.

    Hi PI Experts
        I have XI scenario: MAIL  XI SAP (ABAP Proxy), the process is
    1.     XI will receive tab delimited file as attachment in mail.
    2.     XI will convert the tab delimited file into XML, then map to the target structure.
    3.     Target will be posted into ECC through ABAP Proxy.
    Can anyone help me how can I convert the attachment file (i.e. Tab delimited file) to XML while configuring the sender side.
    Thanks in Advance

    I just grabed what I answered from another thread. It should work.
    Processing sequence as follows:
    1. localejbs/AF_Modules/PayloadSwapBean Local Enterprise Bean swap1
    2. localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean tran1
    3. sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local Enterprise Bean mail
    Module Configuration as follows: Fill the XXXX part with your info.
    swap1 swap.keyName payload-name
    swap1 swap.keyValue MailAttachment-1
    tran1 Transform.Class com.sap.aii.messaging.adapter.Conversion
    tran1 Transform.ContentType ext/xml;charset=utf-8
    tran1 xml.conversionType SimplePlain2XML
    tran1 xml.documentName XXXXXXX_Mail
    tran1 xml.documentNamespace http://XXXXX.com.au/XXXX
    tran1 xml.fieldSeparator \t
    tran1 xml.processFieldNames fromConfiguration
    tran1 xml.structureTitle rows
    Once you set up the above configuration, you will get one record at a time.
    Create a souce message interface like the followings:
    XXXXXXXXX_Mail
    rows
    record
    Target message interface:
    XXXXXXXXX
    rows
    field 1
    field 2
    field 3
    Write a UDF function to remove the TAB space
    public removeTABSpace(String record,Container container){
    //write your code here
    StringTokenizer st = new StringTokenizer(record,"\t",false);
    String t="";
    while (st.hasMoreElements()) t += st.nextElement();
    return t;
    Write another UDF to get the field 1 for example:
    public String getField1(String input,Container container){
    int counter=0;
    int beginIndex=0;
    int endIndex=0;
    int i;
    for (i=0;i<input.length();i++){
    if (input.charAt(i)==34){
    counter=counter+1;
    if (counter==1){
    beginIndex=i+1;
    counter=0;
    break;
    for (i=0;i<input.length();i++){
    if (input.charAt(i)==34){
    counter=counter+1;
    if (counter==2){
    endIndex=i;
    counter=0;
    break;
    input=input.substring(beginIndex,endIndex);
    return input;
    Get the mapping like the followings:
    record - removeTABSpace - getField1 - field 1
    If you need to get field 2, you will need to write another UDF similar to the above one to handle it.

  • Convert tab delimited  file content into an xml

    Hi,
    I am completely new to java and i am trying to create a tree of an
    output i have. generally the output is tab delimited and i have a
    sample output in the following link
    http://jena.sourceforge.net/ontology/examples/class-hierarchy/output.txt
    I want to create an xml out of it in the tree format as below
    <Class :Thing>
    (/t) <Class :KoalaWithPhD>
    (/t) <Class :MaleStudentWith3Daughters>
    (/t) <Class :Habitat>
    </Class :Thing>
    note i have added (/t ) just to explain u that kolawithphd is child node of thing ...and so on.
    Can someone throw in a simple code snipet that can help me do this.
    Really appreciate your help
    Thanks
    aks

    You need to detect the amount of indent, and whether the current line is more or less indented. You also need a stack to hold the indents of the previous lines, so the converter knows which one it's matching.
    Assuming the output is like the jena example - spaces only as indent and no non-xml-attribute-value characters in the class names, one possible converter would look like:import java.io.*;
    import java.util.*;
    public class ClassesToXml {
      public static void main (String[] args) {
        try {
          BufferedReader in = null;
          try {
            in = new BufferedReader(new FileReader(args[0]));
            String line;
            int previousIndent = -1;
            LinkedList stack = new LinkedList();
            System.out.print("<classes");
            while ((line = in.readLine()) != null) {
              final int indent = indent(line);
              if (indent <= previousIndent) {
                System.out.println("/>");
                while (indent < previousIndent) {
                  System.out.println("</class>");
                  previousIndent = ((Integer)stack.getFirst()).intValue();
                  stack.removeFirst();
              } else {
                System.out.println(">");
                stack.addFirst(new Integer(previousIndent));
                previousIndent = indent;
              System.out.print("<class name='" +
                               line.substring(line.indexOf("Class ") + 6).trim() +
            System.out.println("/>");
            while (stack.size() > 1) {
              System.out.println("</class>");
              stack.removeFirst();
            System.out.println("</classes>");
          } finally {
            if (in != null) {
              in.close();
        } catch (IOException ioe) {
          ioe.printStackTrace(System.out);
      static int indent (String line) {
        final int length = line.length();
        for (int indent = 0; indent < length; indent++) {
          if (line.charAt(indent) != ' ') {
            return indent;
        return length;
    }Pete

  • Option to read fixed-length format, EXCEL or ASCII TAB delimited

    Hi Experts,
                      I have a requirement for giving an option to read fixed-length format, EXCEL or ASCII TAB delimited in the selection screen.Kindly help me how can i read the fixed length format?
    Thanks,
    Ankita

    As far as I could have understood your problem
    You have to read the file with
    Open dataset  'file path+name'  FOR INPUT in text mode encoding default.
    and move its contents to string type variable
    Transfer to 'file path+name' to v_string.
    Now as per your requirements you need to use Offsets to transfer the data into a work area.
    For example
    wa_task-year=  v_string(4).
    wa_task-month=  v_string+4(2).
    Please confirm if this is your requirement.

  • Help for ----convertion of tab-delimited for download to UNIX

    hi,everyone, I have one question for your kind advice.
    I have managed to find a way to download an tab-delimited file to UNIX.
    which need to define the TAB as hex number.
    I think the tab-delimited should be defined as "23" ,but the outbound is just a
    "#" . and if I changed it to '09', I can get the correct result such as 123&#8594;123
    here, &#8594;is an tab-delimited sign.
    so could you kindly explain the reason,and How can I get the "correct hex number " 09 ?
    hope you  can understand my fuzzy explaination....
    thanks

    dear Atish
    thanks a lot for your kind advice....
    I tried this way and it  works well.
    Though I stilll want to know the reason ...anyone can explain it?
    thanks

  • LSMW: Convertion of special character turn into #

    Hi all,
    Ich am Ulpoading a file in the step 'READ DATA' in LSMW and when I check the result in the next step 'DISPLAY READ DATA' I see that the upload (i do not know if LSMW make an WS_UPLAOD or GUI_UPLOAD or another function) converts a special character that we use in Portugal
    in the file:           Fabricação
    in LSMW after Upload:  Fabrica##o
    The file was an Excel which I saved as txt (tab delimited)
    Who can help??????
    Thanks
    Picasso

    Hi Picasso,
    LSMW is having 'GUI_UPLOAD' function module to upload data.
    GUI_UPLOAD FM is having import parameter CODEPAGE.Whose functinality is to take care of such special character.
    Include which is called for READ DATA step, you can very wel find out that the codepage is not suitable for your Portuguese language.
    Do one thing write an BDC...Call GUI_UPLOAD FM and then Pass CODEPAGE number.
    codepage number you will get from  tcp00 table.
    here is example to take care of special Japanese character:
    CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = l_ws_path
          filetype                = 'ASC'
          has_field_separator     = '#'
          codepage                = '6300'
        TABLES
          data_tab                = i_aenr
        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.

  • Importing a .xls tab delimited file into number

    Hi there... I downloaded a .xls document from the internet and attempted to open it in Numbers. The following import problem presented itself:
    Import Warning - This is a tab delimited document, not a valid Excel document. The data might look different.
    Indeed the data does look different- all of the formatting is visible, and the document is essentially unusable. Is there a way to convert this sort of document into something that can be used in Numbers?
    Thanks

    I opened the document in Text Edit, but was unable to convert tab to commas... here is a clip from the original document when it is opened in both TextEdit and Numbers
    <table border="1">
    <!-- <tr><td colspan = "15" valign="middle" align="center">Date: 2/15/2008</td></tr>-->

  • Is there a way to import/export tab delimited files to a table in Pages 2?

    It seems like Pages is starting to get funtionality that might help wean me off of Excel. In this vein, is it possible to import or export tab delimited files to a table in Pages 2?

    I had some success in Pages 1, but I've only tried a couple of times so far in Pages 2 without success. The trick was to make sure the table is the exact number of columns wide. It's very "klunky" but I've ended up converting the tab-delimited text to a table in AppleWorks, saving the AppleWorks file with the table as a "floating" object (fixed objects don't translate) & opening the file in Pages. It's quicker & easier for most of what I do to just drag & drop in Pages.
    Peggy

  • Import text into a form from a tab delimited file using an action

    Good evening.
    I am using Adobe Acrobat XI Pro
    I have been working all weekend so far on this, and have tried many options.
    What I am wanting is to import a line of data from an excel file into a form, save the file with a name drived from the form fields, close the new file, then go back to the original file, import a line of data, and so on and so on.
    I had all of this working in livecyle with a tool, but now that we are going to Windows 8 and Microsoft Office 2013, the driver that I need to load the excel file into the form is not available--so now I have to redo the forms in Adobe and import using a tab delimited file.
    I would like to do this with an action.
    Thus far, I have the following.
    **Credit goes to George Johnson who helped me with the script to save the file using field names a few months ago**
    To start, I have a folder level script
    mySaveAs = app.trustPropagatorFunction(function(doc,path)
    app.beginPriv();
    var myDoc = event.target;
    myDoc.saveAs(path);
    app.endPriv();
    myTrustedSpecialTaskFunc = app.trustedFunction(function(doc,path)
    //privileged and/or non-privileged code above
    app.beginPriv();
    mySaveAs(doc, path);
    app.endPriv
    //Privileged and/or non-privileged code below
    For the Action, I start with the Form file loaded
    Then I execute a javascript to import the text into the file.
    this.importTextData("/c/data/clerical.txt");
    The next step is to save the file using field names as part of the file name
    --credit goes to George Johnson who assisted me with this on a similar project a few months ago.
    //Get the Field Value
    var fn=getField("Last").valueAsString + "-" + getField("First").valueAsString;
    //Specify the folder
    var fldr = "/c/data/";
    //Determine the full path
    var fp=fldr + fn + ".pdf";
    //save the file
    myTrustedSpecialTaskFunc(this, fp);
    That is as far as I have gotten. 
    What I want to do now is load the original form file, import the next line into the form, save the file, repeat.
    If anyone could assist me, I would greatly appreciate it.
    **note  I had to type this from my I-pad because I kept getting kicked off the internet from my computer.  I hope my code is typed correctly.

    George
    Thank you so much for your response.
    Yes--there are multiple lines in the data file--it will vary from month to month.  It looks like from what you are saying is that I need to do the global variable since it will constantly change, and then increment it as it goes through the text file.  When it reaches the end, then it will stop.
    I looked at the following links--but this is from Adobe 9 API--I don't know if things have changed with XI--especially since 9 used batch processing and XI has actions.
    Count PDF Files
    http://help.adobe.com/livedocs/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/wwhelp/wwhimpl/js/html/ wwhelp.htm?href=JS_API_AcroJS.88.1.html
    Global counter
    http://help.adobe.com/livedocs/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/wwhelp/wwhimpl/js/html/ wwhelp.htm?href=JS_API_AcroJS.88.1.html
    I am not exactly sure how to include this in my code.
    If you could point me in the right direction, I would appreciate it.

Maybe you are looking for

  • Is there anything aside from bad or poorly installed RAM that can cause the three beeps of death?

    So, I've been dealing with a problem with my 2013 non-retina MBP. I've already had it into Apple to be looked at, and they replaced the hard drive and RAM. Unfortunately, it is now out of warranty, and the issues have returned. They are two-fold, and

  • How to set mac shortcuts (for mac and windows OS)

    i am having a bit of an issue. i run windows 7 and mac os on the same computer on different hard drives in this computer. i also have a "mac" keyboard. i am not sure how this may be different from a "windows keyboard" but the point is i need to use t

  • Reminders and notes.. why?

    I'd consider myself a busy working person with two young children to look after single-handed but I still can't honestly believe that people operate in the way Apple thinks we do. Does anybody REALLY have a daily reminders list with.. "Don't forget t

  • Three way join mapping

    I have three tables file, file_location, and file_object as bellow: file_location (file_id, file_system_id, stored_on,...) file (file_id, name, object_id, file_size, ...) file_object (object_id, created_on, ...) I need to issue a query that do three

  • How to refresh JavaScript File.

    I am running JavaScript file on the Folder level. Looks like I am still running the previous version of the file even after I made corrections to the js file. Is it any refresh action I can use in the code or on the keyboard. Is somebody can help wit