Extract data from Pipe Delimited file

Hi everybody,
Could someone provide me the command to extract data from a pipe delimited file ("|") using Open/Read Data set.
I mean eliminating the delimiter ("|") and just picking the data.
Thanks
M

Here you go.. this code snippet parses the input file record by using pipe (variable lv_pipe) as separator, for tab separated file you can use lv_tab like wise...
  TYPES: BEGIN OF ts_field,
           field(50) TYPE c,
         END OF ts_field,
         tt_field TYPE TABLE OF ts_field.
   DATA: ls_record TYPE string,
        ls_input_data TYPE ts_input_data,
        lv_tab TYPE x VALUE '09',
        lv_pipe TYPE C VALUE '|',
        ls_field TYPE ts_field,
        lt_field_tab TYPE tt_field,
        lv_field_index TYPE syindex,
        lv_record_no TYPE syindex.
  FIELD-SYMBOLS: <fs_field> TYPE ANY.
  OPEN DATASET fv_file_path IN TEXT MODE FOR INPUT.
  IF sy-subrc = 0.
    DO.
      lv_record_no = lv_record_no + 1.
      READ DATASET fv_file_path INTO ls_record.
      IF sy-subrc NE 0.
        EXIT.
      ELSE.
        SPLIT ls_record  AT lv_pipe INTO TABLE lt_field_tab.
        CLEAR: lv_field_index, ls_input_data.
        LOOP AT lt_field_tab INTO ls_field.
          lv_field_index = lv_field_index + 1.
          ASSIGN COMPONENT lv_field_index OF STRUCTURE
            ls_input_data TO <fs_field>.
          IF sy-subrc = 0.
            <fs_field> = ls_field-field.
          ENDIF.
        ENDLOOP.
        APPEND ls_input_data TO ft_input_data.
      ENDIF.
    ENDDO.
    CLOSE DATASET fv_file_path.

Similar Messages

  • How to Extract Data from the PDF file to an internal table.

    HI friends,
    How can i Extract data from a PDF file to an internal table....
    Thanks in Advance
    Shankar

    Shankar,
    Have a look at these threads:-
    extracting the data from pdf  file to internal table in abap
    Adobe Form (data extraction error)
    Chintan

  • How can I extract data from a sound file in carbon

    hello,
    I am a student and I start recently learning carbon. I have to do a application which can read and extract data from a sound file and use that data to do some kind of visual representation of the file. I would like to know if someone can give some directions, tutorial,some code sample etc.
    thank you for your help
    chenita7

    hello orangekay
    My idea is to create an application that can read a sound file( AIFF, MP3 or other) in order to extract some kind of data ( numbers or any values) and use that data to represent the sound file visually.
    I dont know which kind of data can be extract from a sound file, and in which way i can manipulate that data to became a visual representation of the sound file. this is what I want to do as my second assignment for a subject at school, introduction to programming. has to be done based in carbon.
    regards
    chenita7

  • Need to read data from pipe separated file using POJO?

    Hi,
    I need to read data from pipe separated file using POJO.
    There is config.properties file which consists of the
    data mapping.
    Can you help me with sample code or help?
    Regards
    Regards
    Taton
    Edited by: Taton on Mar 7, 2009 4:41 PM

    It's not possible to read from a file without using classes from the core API*. You'll have to get clarification from your instructor as to which classes are and are not allowed.
    [http://java.sun.com/docs/books/tutorial/essential/io/]
    *Unless you write a bunch of JNI code to replicate what the java.io classes are doing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Hi i am new to labview. i want to extract data from a text file and display it on the front panel. how do i proceed??

    Hi i am new to labview
    I want to extract data from a text file and display it on the front panel.
    How do i proceed??
    I have attached a file for your brief idea...
    Attachments:
    extract.jpg ‏3797 KB

    RoopeshV wrote:
    Hi,
    The below code shows how to read from txt file and display in the perticular fields.
    Why have you used waveform?
    Regards,
    Roopesh
    There are so many things wrong with this VI, I'm not even sure where to start.
    Hard-coding paths that point to your user folder on the block diagram. What if somebody else tries to run it? They'll get an error. What if somebody tries to run this on Windows 7? They'll get an error. What if somebody tries to run this on a Mac or Linux? They'll get an error.
    Not using Read From Spreadsheet File.
    Use of local variables to populate an array.
    Cannot insert values into an empty array.
    What if there's a line missing from the text file? Now your data will not line up. Your case structure does handle this.
    Also, how does this answer the poster's question?

  • How to extract data from multiple flat files to load into corresponding tables in SQL Server 2008 R2 ?

    Hi,
              I have to implement the following scenario in SSIS but don't know how to do since I never worked with SSIS before. Please help me.
              I have 20 different text files in a single folder and 20 different tables corresponding to each text file in SQL Server 2008 R2 Database. I need to extract the data from each text file and
    load the data into corresponding table in Sql Server Database. Please guide me in how many ways I can do this and which is the best way to implement this job.  Actually I have to automate this job. Few files are in same format(with same column names
    and datatypes) where others are not.
    1. Do I need to create 20 different projects ?
                   or
        Can I implement this in only one project by having 20 packages?
                 or
        Can I do this in one project with only one package?
    Thanks in advance.

    As I said I don't know how to use object data type, I just given a shot as below. I know the following code has errors can you please correct it for me.
    Public
    Sub Main()
    ' Add your code here 
    Dim f1
    As FileStream
    Dim s1
    As StreamReader
    Dim date1
    As
    Object
    Dim rline
    As
    String
    Dim Filelist(1)
    As
    String
    Dim FileName
    As
    String
    Dim i
    As
    Integer
    i = 1
    date1 =
    Filelist(0) =
    "XYZ"
    Filelist(1) =
    "123"
    For
    Each FileName
    In Filelist
    f1 = File.OpenRead(FileName)
    s1 = File.OpenText(FileName)
    rline = s1.ReadLine
    While
    Not rline
    Is
    Nothing
    If Left(rline, 4) =
    "DATE"
    Then
    date1 (i)= Mid(rline, 7, 8)
     i = i + 1
    Exit
    While
    End
    If
    rline = s1.ReadLine
    End
    While
    Next
    Dts.Variables(
    "date").Value = date1(1)
    Dts.Variables(
    "date1").Value = date1(2)
    Dts.TaskResult = ScriptResults.Success
    End
    Sub

  • Is there an utilitity to extract data from a datapump file since impdp give

    Hi,
    meanwhile doing a reorganization, customer has exported a table of various GBytes with expdp and has dropped the table afterwards. The problem is that it recives an ORA-600 [klaprs_11] error related to corrupted file when executing impdp.
    Customer now requires to recover so many rows as possible from the corrupted datapump export file. Is there any tool available to do this?.
    Thanks.
    Regards,
    Alberto Aragón

    Pl post details of OS and database versions, along with the complete import command and the complete error message.
    There is no way of extracting data from a datapump export file.
    These MOS Docs may help
    ORA-600 [Klaprs_11] On Impdp Using Dumpfile Exported with COMPRESSION=ALL          (Doc ID 739849.1)
    DATAPUMP IMPORT FAILS WITH ORA-39014, ORA-31672 AND ORA-600 [klaprs_11]/[klaprs_12]/[klaprs_14] ERRO          (Doc ID 1082741.1)
    Datapump Import Triggering ORA-00600 [klaprs_11] on Few Objects          (Doc ID 743483.1)
    Datapump Import impdp Fails With ORA-600 [klaprs_11]          (Doc ID 1073547.1)
    HTH
    Srini

  • I have a problem to  extract data from oracle dump file (.dmp) using oracle database or any other tools.

    There is IMP utility which provides me data as graphical way. But i need extract data in such a way so that i could able to use in my application.
    thanks,
    mohan

    Hi,
    EdStevens
    Actually I was using SQL Developer. Sorry for the wrong define question. Now the real problem is:
    I want to read or extract data in a txt file from Oracle Dump (.dmp) file without using Oracle sqlPlus or Oracle Database.
    No need to say that i am able to extract dump data using sqlPlus. But for that, there is a little burden to install oracle database
    or sql Developer.
    I also listen about Oracle Loader a little bit. Is it a tool for providing extraction of data from Oracle dump file.
    Thanks for your previous reply,
    And now waiting for your suggestion.
    thanks,
    mohan

  • How to Extract data from a flat file and how to upload it into table

    Hi
    i want to extract the data from a web page, that data i want to keep in text file.
    from the text file i want to read it and i want to upload into table
    can any one help me its very urgent

    here is my 20min try without debugging (needs a rs232 and loopback connector )
    use the probe and highlight the dataflow to see how it works.
    as always:  there are many ways to solve your problem
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'
    Attachments:
    read write file to RS232.vi ‏69 KB

  • Importing data from tab delimited file

    Hi everyone,
    This is my first question on here so I hope I am doing the right thing.
    I've searched online as much as I can to find an answer or a way to fix my problem but I have not been able to find a resolution.
    My issue is I'm trying to import name and contact information from a excel file, that I have saved as a tab delimited file, into a fillable PDF file. I'm able select the text file through the import option and it shows the correct information as different rows that I can import but when I select one and click on to finish the import of the data I get an error message advising that some of the text could not be imported. The issue is nothing is being imported at all.
    I've made sure that all the relevant fields are the same name as what the form has but still cannot get anything to import.
    Does anyone have any ideas why this may not be working? Also I basically have no ability to write JavaScript to import the information otherwise I would look at travelling down that path.
    Please let me know if I need to be any more specific.
    Regards,
    Adam

    Ok I can share the form itself and will need to quickly create some data itself to go along with it
    PDF Form Shared Files - Acrobat.com 
    Here is the tab delimited file I am trying to use (well the format anyway).
    Test Data File Shared Files - Acrobat.com
    Adam
    Thanks Pat Willener

  • Extracting data from a text file

    Hi there, I am trying to create a program that can extract a message from a csv file. The csv is an output from a database that stores messages with the following syntax:
    username,password,date,to,from,subject,body
    I am very new to java (about 3 days) so any help would be appreciated.
    Thanks

    Lesson: I/O: Reading and Writing (but no 'rithmetic)
    String.split
    Resources for Beginners
    Sun's basic Java tutorial
    Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    http://javaalmanac.com. A couple dozen code examples that supplement The Java Developers Almanac.
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's Thinking in Java (Available online.)
    Joshua Bloch's Effective Java
    Bert Bates and Kathy Sierra's Head First Java.
    James Gosling's The Java Programming Language. Gosling is the creator of Java. It doesn't get much more authoratative than this.

  • I want to extract data from oracle dump file (.dmp) using oracle database or any other tools.

    There is import which provides me data as graphical way. But i need extract data in such a way so that i could able to use in my application.
    thanks,
    mohan

    This isn't a SQLDeveloper question. You will get better answers in the Database - General forum.
    Oracle dump files produced by the exp or expdp utilities are inproprietary formats which can only be read by the imp or impdp utilities respectively.
    The best way to get data out of a dump file is to import it into a database and then extract it to plain text files using SQL.
    Alternatively, leave it in the database and your application can access it there.
    The exp dump file is mostly plain text, but the format is not published so you could waste a lot of time figuring it out.

  • How to extract data from OMElement object file attachment SOAP Service

    We are having Axis2 Tomcat6 Webservice on SOAP WSDL
    The Webservice method is like this
    public String uploadGpxFile(OMElement omEle) throws AxisFault {
        // Extract file attachment from omEle
       // store in database
       return "ok";
    So, I just went through the documentation and executed
    omEle.getText();
    This printed the attached data like this
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
       <soapenv:Body>
          <ns:uploadGpxFileResponse xmlns:ns="..........">
             <ns:return><![CDATA[ MY REQUIRED XML DATA IS HERE ]]></ns:return>
          </ns:uploadGpxFileResponse>
       </soapenv:Body>
    </soapenv:Envelope>
    So, I essentially want to extract this data and store in database. My simple question is how to do it!
    It sounds crazy but, I am quite new to Java. I was actually debugging client and found there is a problem in server and started fixing it!! It would be very helpful if someone helps

    Hi,
    as far as i know you have to use sql to archive your goal, i.e. write your own methods for every complex sql-statement you want to use. thats the sad thing about the whole ORM-concept.
    Greetings,
    dsp

  • Reg Extracting data from PDF using file adapter

    Hi Experts,
                 In my business process I will get different files in the form of pdf. I have to extract the fields from the file and send it to ECC system. Can any one suggest me how to do it without using CA.
    Regards
    Suresh

    you might have to use a custom solution.
    you will find tips here Trouble writing out a PDF in XI/PI?

  • How to extract data from offline PDF files as batch processing

    Hello.
    I want to use Adobe Interactive forms as batch processing.
    For instances,
    1. Users download offline PDF files.
    2. Users inputs data on their local PCs.
    3. Users upload these PDF files in one folder.
    4. Program can read data form PDF files on that folder. and put data to ERP at night.
    I' d like to know how to implement a program with Java or ABAP.
    Regards.
    Koji.

    Hi,
    It's possible to do it but first be sure that the SAP system can read the directory while your program is executed in background .
    Then you have to read the content of the directory and process each file you found.
    Look at this standard ABAP object cl_gui_frontend_services , you will find method for browsing a directory and retrieve list of file .
    Afterwards you have to process each file , for this have a look at this wiki code sample i wrote for processing inbound mail with adobe interactive form, it should help you [Sample Code for processing Inbound Mail with Adobe Interactive Forms|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/sampleCodeforprocessingInboundMailwithAdobeInteractive+Forms]
    Hope this help you .
    Best regards.

Maybe you are looking for

  • Parallels desktop 8

    Hello, my question is: for Parallels desktop 8 is better Macbook 13 or 15? MacBook Pro 13 •Intel Core i7 dual-core a 2,9GHz, Turbo Boost fino a 3,6GHz •8GB di SDRAM DDR3 a 1600MHz - 2x4GB •512GB - Unità a stato solido •SuperDrive 8x (DVD±R DL/DVD±RW/

  • G4 Titanium question

    I have a G4 titanium with no screen that my son was using for movies with an apple cinema display. The G4 is working fine. I wiped the HD and then verified it. The cinema display was sold and I am trying to sell the G4. A potential buyer asked me if

  • Computer not Turing on!!!!!!!!!

    Why isn't my computer turning on? I did the diagnostic test,and sometimes it show that I need to replace both the power supply and the logic board. Sometimes it show LED 1 and sometimes it shows LED 1&2. 2 time though, it has turned on. What the heck

  • Quicktime from keynote

    Whatever I do I cannot get the controller to show up in a QT movie made via Keynote. Can anyone suggest a way?

  • OSX Mountain Lion for MacBook Pro (early 2011)

    I recently updated my software from OSX Lion to OSX Mountain Lion and im noticing a slightly sluggish performance when opening and closing apps that i never experienced before when using Lion. What could be causing this, and how can it be fixed? Than