XLS to CSV Converstion

Hi,
I have a requirement to convert from XLS file to CSV. Can I know how can we automize the conversion process?
Requirement:
1. XLS file will be available daily in BW Application server
2. Before uploading into BW Objects the file should be in CSV format
Thanks for your inputs

Hi,
From your excel workbook you can run the following code (click on Alt + F11 - and paste this code in ThisWorkbook):
Private Sub Workbook_Open()
DestFile = InputBox(Filename)
    ActiveWorkbook.SaveAs Filename:=DestFile, FileFormat:= _
        xlCSV, CreateBackup:=False
End Sub
This small code will open a window for you to type the path of the csv file that will be saved
This is just a starter, of course you can enhance the tool with Vbscript or VBA.
Hope it helps,
Gilad

Similar Messages

  • How do i convert a pdf into an xls or csv file

    how do i convert a pdf into an xls or csv file   ? thnx

    HI newapiary
    You can either use Adobe Acrobat or Adobe ExportPDF Online Service.
    Please Refer : https://www.acrobat.com/exportpdf/en_GB/convert-pdf-to-word.html

  • I need help when i scan pages to my computer how do i save them as .doc, .txt, .xls, .xlxs, .csv, .p

    when i scan the pages I need scaned to my computer they are coming up as imported pictures and videos. Im needing to save them as one of the following .doc, .txt, .xls, .xlxs, .csv, .pdf, .docx, .xlsx what do i do?

    Hi, krystal!
    So that the Community can help you better, we will need to know exactly which operating system is running on your computer, and which application you're using to scan and save. That, and any other details you'd like to give will help the Community better understand your issue!
    If this is a time-sensitive matter, our US-based technical support team is standing by, ready to help 24/7 via Email at http://bit.ly/EmailCanon or by phone at 1-800-OK-CANON (1-800-652-2666) weekdays between 10 AM and 10 PM ET (7 AM to 7 PM PT).
    Thanks and have a great day!

  • Write the results script of results log pane to XLS or CSV file with VBA.

    Hi,
    How can I write the results script of results log pane to XLS or CSV file with VBA code or something? I tried so hard but i can't.
    Thanks

    MoGas,
    This is actually not a trivial process. You need to use the results object and code it to write to your file (it is described in the help files).
    e-Tester automatically saves the results log as a text file so you may just want to stick with that for simplicity.

  • Export Mac Mail message list as XLS, Numbers, CSV file?

    I'm wondering if there's a practical way to export the message list in my Mac Mail inbox as a spreadsheet (e.g., XLS, Numbers, CSV &c)? I figured there must be a file of this sort in my mail library somewhere, but wasn't sure where to look. Any ideas, shortcuts, quick & easy answers? Thanks!

    export bookmarks to a file, open this file in safari and enter command+I. You can of course simply attach the file to your message.
    Message was edited by: V.K.

  • How to Store resultset in .xls or .csv format

    How we can store a resultset in .xls or .csv format, When we don't know the colum names,or no. of columns in the result set, or you want to generlize the code.
    Each time for every query execution.getting the field from the resultset and appending ',' to it, and storing it in file is doing the work as i want to do.
    I want to use it as to take backup of any table from database server to my system
    if any other rather thn xls or csv by that i can reload it easily if required.
    Pleae help

    There are lots of ways to do this via tools or rolling your own. I use the FormattedDataSet API for this.
    import com.fdsapi.*;
    FormattedDataSet fds=new FormattedDataSet();
    String csv=null;
    csv=fds.getFormattedDataSet("select * from table", "csv");
    // or
    csv=fds.getFormattedDataSet(resultSet.getMetaData(), resultSet, "csv");Here is a link to a live demo that allows you to format in html/xml/csv. Although the example on this page formats form submissions the code would work for ResultSets too.
    http://ssouza.kgbinternet.com/fdsapi/basicdemo.jsp
    steve - http://www.fdsapi.com

  • How Can I Import Contacts from Excel (XLSX/XLS) and CSV file to VCF File?

    Hi Friends,
    I have stored my all official and personal contacts list in the Excel (XLSX/XLS) spreadsheet and CSV file from long time. But now, I want to move my all contacts in an MS outlook 2013 and also Samsung S4 Contacts directory. But for this process, I require to import all Excel and CSV file contacts into VCF file format. So that, I could export vCard (VCF) file in the outlook and Samsung S4 contacts book. But I don't know about this process that how to import Excel and CSV file contacts into vCard format. If anyone has best solution to import and export excel or CSV file contacts into VCF file, so please share with me that information.
    Thanks & Best Regards
    Jackson T.
    <Edited By Host>

    https://itunes.apple.com/gb/app/csv-to-vcard/id713295900?mt=12

  • Polish Characters XLS to CSV to TXT conversion issue

    Hi,
    I am trying to convert the XLS file to CSV and then to TXT (UFT8) file but the polish characters are shown as "?" in CSV and TXT file. Any experts help please.
    Thanks,
    Genoo

    Any help please, its quiet urgent.
    Thanks,
    Genoo

  • Xls and csv file format

    I have a xls file that I can read and modify using POI. Users are providing another file in csv format that the program should read and make adjustments to the xls already read in the memory. Can anyone suggest the most efficient way to implement this?

    Its possible but I don't see a real clean way of implementing it. There are also a lot cases to consider when doing the data merge.
    Lets say its the most simple case where the data from the csv should be appended to the excel file starting one row after the last row of data.
    For writing data to a HSSFSheet in POI you should look at the poi examples, there is a method that returns the last row num on the sheet, then from that you create new rows while incrementing the last row num for each csv record. Then for each column in the csv you need to create a new HSSFCell from the HSSFRow object in Poi, set its cell type to texta and sets its value to the csv value.
    Thats the main loop right there. As far as reading a text file as csv format so you can easily navigate it on a row by row and column by column basis I'm not sure whats out there to do that for you.
    Hope that helps! - Duncan

  • Converting .xls to .csv file using pl/sql

    Hi All,
    i have a directory say 'C:\datafile\'. I will be getting .xls file into this directory. I need to change it to .csv and load into oracle tables using sql loader.
    Any inputs on this..
    thanks..

    Etbin wrote:
    Even if there's only table data to deal with it will be quite demanding to ignore just colors, font types, formats, sizes you name it the "innovative" users can think of.Even if it had no additional formatting by users and was just a spreadsheet populated with table style data, it would still be nigh on impossible to read the contents intelligently, using any of the file access facilities available as standard in PL/SQL (e.g. UTL_FILE)...
    Just looking at the contents of the file in notepad, where many of the bytes are unmappable to readable characters...
    ÐÏࡱᠠ              >  þÿ                              þÿÿÿ    þÿÿÿ       ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ        u'ÍÁ€    á  °Á    â   \ p   user                                                                                                         B  °a   À  =  œ               ¯   ¼   =  x - Ð\.;8      X@        "       ·   Ú    1 &     ÿ      C o u r i e r   N e w 1 &     ÿ      C o u r i e r   N e w 1 &     ÿ      C o u r i e r   N e w 1 &     ÿ      C o u r i e r   N e w     "£"#,##0;\-"£"#,##0    "£"#,##0;[Red]\-"£"#,##0    "£"#,##0.00;\-"£"#,##0.00#    "£"#,##0.00;[Red]\-"£"#,##0.005 * 0  _-"£"* #,##0_-;\-"£"* #,##0_-;_-"£"* "-"_-;_-@_-, ) '  _-* #,##0_-;\-* #,##0_-;_-* "-"_-;_-@_-= , 8  _-"£"* #,##0.00_-;\-"£"* #,##0.00_-;_-"£"* "-"??_-;_-@_-4 + /  _-* #,##0.00_-;\-* #,##0.00_-;_-* "-"??_-;_-@_-à      õÿ            À à     õÿ   ô        À à     õÿ   ô        À à     õÿ   ô        À à     õÿ   ô        À à      õÿ   ô        À à      õÿ   ô        À à      õÿ   ô        À à      õÿ   ô        À à      õÿ   ô        À à      õÿ   ô        À à      õÿ   ô        À à      õÿ   ô        À à      õÿ   ô        À à      õÿ   ô        À à                   À à   + õÿ   ø        À à   ) õÿ   ø        À à   , õÿ   ø        À à   * õÿ   ø        À à         õÿ   ø        À “ €ÿ“ €ÿ“ €ÿ“ €ÿ“  € ÿ“ €ÿ`   …  Ö     Sheet1Œ   , Á Á  T ü H                   EMPNO  ENAME  MGR  DEPTNO  FRED  JIM  BOB  JAMES  TIMÿ   |     ¶  F  
               u'ÍÁ€                ’  L 
         d          ü©ñÒMbP?_   *    +    ‚   €          %   á   Á      ƒ    „    ¡ "   á               à?      à?  U                       á            á            á            á            á            á       ý
              ý
            ý
            ý
            ~
           ð?ý
           ~
          $@~
            @ý
           ½       ð?   4@ ~
           @ý
           ½       ð?   $@ ~
           @ý
           ½        @   4@ ~
           @ý
           ½        @   4@ ×  ¢  d 8 * 2 2 2 > ¶    @                          ï    7   (Note: it was cut short, this is just an example)
    Let's face it, you just wouldn't want to try and decipher that. That's what Microsoft have provided ODBC drivers for.

  • Problem While Converting File From .xls to .csv consisting of Chinese Data

    Hi,
    I want to import the Excelsheet data to HTML DB which consists of information in chinese language. To import this excelsheet data i am converting this excel file to .csv. After coverting it to .csv every chinese character will gets converted to question mark (???). I want to import this chinese data as it is. Please help me regarding this issue.
    Vilas Magi.

    Hi
    I am trying to export Japanese data to .CSV but the CSV contains junk characters which are correctly displayed in the browser.
    Can anybody help me on this issue?
    Thanks in advance

  • The report options under "configure" and CSV or xls.

    The report options under “configure” does not give .csv or xls as options. Instead of using vi to pass data to database, is there a simple way to transfer all the results (just like the way in the report that automatically generated) to .csv or xls...
      Thanks.

    Hi,
    in order to modify the report generation, you have to understand the way how TestStand works in regard of the report generation.
    There is a tutorial which explains this which you can find here. But please note that the tutorial is currently undergoing an improvement process. 
    The reason that the report options don't give you the option for xls or csv as report is: 
    Neither xls nor csv are predefined. So for example measurement values in xls can be placed in a special worksheet or included in a main sheet in a certain column.
    hope this helps,
    Norbert 
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Csv rtf and xls files in file sender

    Hi Experts,
    I had a requirement to design an interface, its basically just a file to file with certain mappings as per business requirements.
    The input file is currently expected in .csv or .xml or .xls.
    My query (can be even be considered juvenile:-) ) is ,
    if csv can be processedd with FCC, why is it that xls cannot?, saving the xls as csv can be done but since its an automated process it will be out of scope to do t manually
    The other query was, with more files expected in rtf and other formats..what is the best way to outline the interface?
    Request you to elucidate on the above
    Regards,
    Ibrahim

    >
    Ibrahim wrote:
    > Hi Experts,
    >
    > I had a requirement to design an interface, its basically just a file to file with certain mappings as per business requirements.
    >
    > The input file is currently expected in .csv or .xml or .xls.
    >
    > My query (can be even be considered juvenile:-) ) is ,
    >
    > if csv can be processedd with FCC, why is it that xls cannot?, saving the xls as csv can be done but since its an automated process it will be out of scope to do t manually
    XLS is a different format. It is not a text file. Eg. a PDF ... is of a different format... it is not a text file.
    For any format other that a TEXT file, you will have to custom code. FCC will apply only to text formats and csv is a text format.
    For excel, PDF etc you can use modules to read or write contents
    eg. /people/shabarish.vijayakumar/blog/2009/05/17/trouble-writing-out-a-pdf-in-xipi
    >
    > The other query was, with more files expected in rtf and other formats..what is the best way to outline the interface?
    >
    > Request you to elucidate on the above
    >
    > Regards,
    > Ibrahim
    If you have different formats to be read, make sure you configure different adapters for each and not a single adapter.
    A single adapter can be used if all you need is to pick files and drop them somewhere doing nothing on the content

  • Problem in uploading xls/csv file with Email address through oracle forms

    Dear all,
    I've created an interface to upload data from xls
    and csv files to database tables.
    I'm sucessed in this. Now i'm facing an issue.
    If the xls/csv file having Email address,the
    upload activity is not working..junk characters is
    getting stored.
    I came to know that, xls .csv file having email
    address with hiperlink. so this may cause the
    issue (just guessing)..
    we can't restrict users to upload email without
    hiperlink.. so what is the alternative to do
    this..
    Email address
    [email protected]
    [email protected]
    [email protected]
    etc...

    Can you give some more information:
    What versions of Forms, database, Java, browser are you using?
    How are you uploading data? Please show us your code.
    What do you mean by "email with a hyperlink"?

  • REg Upload of data through Flat file .....  .XLS or .TXT or .CSV

    Hi,
    I am trying to upload flat file data using the FM GUI_UPLOAD for .TXT file and
    FM TEXT_CONVERT_XLS_TO_SAP for .Xls and .csv files
    My internal table is as follows
    TYPES : BEGIN OF ty_f64,
                     field(255) type c,
                  END OF ty_f64.
    data : it_f64 type table of ty_f64.
    Example Flat file data is as follows
    H     20112008     DR     0001     20112008     INR
    L     01     61     1000          
    L     50     41000     1000          
    H     20112008     DR     0001     20112008     INR
    L     01     61     1000          
    L     50     41000     500          
    L     50     41000     400          
    L     50     41000     100          
    My problem is that only the first field i.e H or L is getting updated into my internal table but I want whole record to be the content in one row
    i.e in RUN TIME I see the internal table data as
    H
    L
    L
    H
    L
    L
    L
    regards
    Prasanth

    Check the below code
    REPORT  ZSRK_073                            .
    CLASS CL_ABAP_CHAR_UTILITIES DEFINITION LOAD.
    TYPES : BEGIN OF TY_F64,
                     FIELD(255) TYPE C,
                  END OF TY_F64.
    DATA : IT_F64 TYPE TABLE OF TY_F64,
           WA_F64 TYPE TY_F64.
    TYPES : BEGIN OF TY_HEADER,
           RECNO TYPE I,
           INDICATOR,
           BLDAT TYPE BLDAT,
           BLART TYPE BLART,
           BUKRS TYPE BUKRS,
           BUDAT TYPE BUDAT,
           WAERS TYPE WAERS,
           END OF TY_HEADER.
    TYPES : BEGIN OF TY_ITEM,
            RECNO TYPE I,
            INDICATOR,
            NEWBS TYPE NEWBS,
            NEWKO TYPE NEWKO,
            WRBTR(16), " TYPE WRBTR,
            END OF TY_ITEM.
    TYPES : BEGIN OF TY_TAB,
            F1,
            F2(10),
            F3(17),
            F4(17),
            F5(10),
            F6(5),
            END OF TY_TAB.
    DATA : IT_HEADER TYPE TABLE OF TY_HEADER ,
           IT_ITEM TYPE TABLE OF TY_ITEM,
           WA_HEADER TYPE TY_HEADER,
           WA_ITEM TYPE TY_ITEM,
           IT_TAB TYPE TABLE OF TY_TAB,
           WA_TAB TYPE TY_TAB.
    DATA : L_REC TYPE I,
           FLAG.
    CONSTANTS : C_HTAB TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
    DATA : FNAME TYPE STRING VALUE 'C:\TTT1.xls',
           L_FILE LIKE RLGRAP-FILENAME.
    IF FNAME CS '.TXT'.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME = FNAME
          FILETYPE = 'ASC'
        TABLES
          DATA_TAB = IT_F64.
      PERFORM SPLIT_TEXT_TABLE TABLES IT_F64.
    ELSEIF FNAME CS '.XLS'.
      L_FILE = FNAME.
      PERFORM UPLOAD_XLSFILE TABLES IT_TAB
                             USING L_FILE.
      PERFORM SPLIT_XLS_TABLE TABLES IT_TAB.
    ELSEIF FNAME CS '.CSV' .
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME = FNAME
          FILETYPE = 'ASC'
        TABLES
          DATA_TAB = IT_F64.
      PERFORM SPLIT_CSV_TABLE TABLES IT_F64.
    ENDIF.
    *&      Form  UPLOAD_XLSFILE
          text
    -->  p1        text
    <--  p2        text
    FORM UPLOAD_XLSFILE TABLES P_TABLE
                        USING P_FILE.
      DATA : L_INTERN TYPE KCDE_CELLS OCCURS 0 WITH HEADER LINE.
      DATA : L_INDEX TYPE I.
      DATA : L_START_COL TYPE I VALUE '1',
             L_START_ROW TYPE I VALUE '1',
             L_END_COL TYPE I VALUE '256',
             L_END_ROW TYPE I VALUE '65536'.
      FIELD-SYMBOLS : <FS>.
      CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
        EXPORTING
          FILENAME                = P_FILE
          I_BEGIN_COL             = L_START_COL
          I_BEGIN_ROW             = L_START_ROW
          I_END_COL               = L_END_COL
          I_END_ROW               = L_END_ROW
        TABLES
          INTERN                  = L_INTERN
        EXCEPTIONS
          INCONSISTENT_PARAMETERS = 1
          UPLOAD_OLE              = 2
          OTHERS                  = 3.
      IF SY-SUBRC <> 0.
        FORMAT COLOR COL_BACKGROUND INTENSIFIED.
        WRITE : / 'File Error'.
        EXIT.
      ENDIF.
      IF L_INTERN[] IS INITIAL.
        FORMAT COLOR COL_BACKGROUND INTENSIFIED.
        WRITE : / 'No Data Uploaded'.
        EXIT.
      ELSE.
        SORT L_INTERN BY ROW COL.
        LOOP AT L_INTERN.
          MOVE L_INTERN-COL TO L_INDEX.
          ASSIGN COMPONENT L_INDEX OF STRUCTURE P_TABLE TO <FS>.
          MOVE L_INTERN-VALUE TO <FS>.
          AT END OF ROW.
            APPEND P_TABLE.
            CLEAR P_TABLE.
          ENDAT.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " UPLOAD_XLSFILE
    *&      Form  SPLIT_TEXT_TABLE
          text
         -->P_IT_F64  text
    FORM SPLIT_TEXT_TABLE  TABLES   IT_F64 .
      LOOP AT IT_F64 INTO WA_F64.
        IF WA_F64+0(1) = 'H'.
          SPLIT WA_F64 AT C_HTAB INTO      WA_HEADER-INDICATOR
                                           WA_HEADER-BLDAT
                                           WA_HEADER-BLART
                                           WA_HEADER-BUKRS
                                           WA_HEADER-BUDAT
                                           WA_HEADER-WAERS.
          CLEAR FLAG.
          IF FLAG EQ SPACE.
            L_REC = L_REC + 1.
            WA_HEADER-RECNO = L_REC.
            FLAG = 'X'.
          ENDIF.
          APPEND WA_HEADER TO IT_HEADER.
          CLEAR WA_HEADER.
        ELSEIF WA_F64+0(1) = 'L'.
          SPLIT WA_F64 AT C_HTAB INTO    : WA_ITEM-INDICATOR
                                            WA_ITEM-NEWBS
                                            WA_ITEM-NEWKO
                                            WA_ITEM-WRBTR.
          IF FLAG EQ 'X'.
            WA_ITEM-RECNO = L_REC.
          ENDIF.
          APPEND WA_ITEM TO IT_ITEM.
          CLEAR WA_ITEM.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " SPLIT_TEXT_TABLE
    *&      Form  SPLIT_xls_TABLE
          text
         -->P_IT_TAB  text
    FORM SPLIT_XLS_TABLE  TABLES   IT_TAB .
      LOOP AT IT_TAB INTO WA_TAB.
        IF WA_TAB-F1 = 'H'.
          WA_HEADER-INDICATOR = WA_TAB-F1.
          WA_HEADER-BLDAT = WA_TAB-F2.
          WA_HEADER-BLART = WA_TAB-F3.
          WA_HEADER-BUKRS = WA_TAB-F4.
          WA_HEADER-BUDAT = WA_TAB-F5.
          WA_HEADER-WAERS = WA_TAB-F6.
          CLEAR FLAG.
          IF FLAG EQ SPACE.
            L_REC = L_REC + 1.
            WA_HEADER-RECNO = L_REC.
            FLAG = 'X'.
          ENDIF.
          APPEND WA_HEADER TO IT_HEADER.
          CLEAR WA_HEADER.
        ELSEIF WA_TAB-F1 = 'L'.
          WA_ITEM-INDICATOR = WA_TAB-F1.
          WA_ITEM-NEWBS = WA_TAB-F2.
          WA_ITEM-NEWKO = WA_TAB-F3.
          WA_ITEM-WRBTR = WA_TAB-F4.
          IF FLAG EQ 'X'.
            WA_ITEM-RECNO = L_REC.
          ENDIF.
          APPEND WA_ITEM TO IT_ITEM.
          CLEAR WA_ITEM.
        ENDIF.
        CLEAR WA_TAB.
      ENDLOOP.
    ENDFORM.                    " SPLIT_xls_TABLE
    *&      Form  SPLIT_CSV_TABLE
          text
         -->P_IT_F64  text
    FORM SPLIT_CSV_TABLE  TABLES   IT_F64 .
      LOOP AT IT_F64 INTO WA_F64.
        IF WA_F64+0(1) = 'H'.
          SPLIT WA_F64 AT '|' INTO      WA_HEADER-INDICATOR
                                           WA_HEADER-BLDAT
                                           WA_HEADER-BLART
                                           WA_HEADER-BUKRS
                                           WA_HEADER-BUDAT
                                           WA_HEADER-WAERS.
          CLEAR FLAG.
          IF FLAG EQ SPACE.
            L_REC = L_REC + 1.
            WA_HEADER-RECNO = L_REC.
            FLAG = 'X'.
          ENDIF.
          APPEND WA_HEADER TO IT_HEADER.
          CLEAR WA_HEADER.
        ELSEIF WA_F64+0(1) = 'L'.
          SPLIT WA_F64 AT '|' INTO    : WA_ITEM-INDICATOR
                                            WA_ITEM-NEWBS
                                            WA_ITEM-NEWKO
                                            WA_ITEM-WRBTR.
          IF FLAG EQ 'X'.
            WA_ITEM-RECNO = L_REC.
          ENDIF.
          APPEND WA_ITEM TO IT_ITEM.
          CLEAR WA_ITEM.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " SPLIT_CSV_TABLE

Maybe you are looking for