How to read data from an word file

Hi to all experts.
My requirement is to read a word file and convert it to a text file.How to do it?

Try the following code.
When u execute the following code it will ask u to browse to the "word Document' u wanna read.
PARAMETERS: p_path   LIKE rlgrap-filename.
data :lv_filename type string.
data : itab type TABLE OF string.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path .
  CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    CHANGING
      file_name = p_path.
  IF sy-subrc <> 0.
    MESSAGE 'Error getting File Information' TYPE 'S'.
  ENDIF.
START-OF-SELECTION.
        lv_filename =  p_path.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
        filename                = lv_filename
        filetype                = 'ASC'
        read_by_line            = 'X'
      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 'ERROR UPLOADING DATA' TYPE 'E'.
    ENDIF.
I thing it should work.

Similar Messages

  • Help! How to read data from an Excel file?

    Hi,
    I need to read data from an Excel file that may contain more then one table in a sheet. How can I read them?
    I would be eternally grateful to anyone who can give me any information.

    Did you try POI from Apache?
    http://jakarta.apache.org/poi/index.html

  • How to read data from the excel file using java code.

    Hi to all,
    I am using below code to getting the data from the excel file but I can't get the corresponding data from the specific file. can anyone give me the correct code to do that... I will waiting for your usefull reply......
    advance thanks....
    import java.io.*;
    import java.sql.*;
        public class sample{
                 public static void main(String[] args){
                      Connection connection = null;
                          try{
                               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                               Connection con = DriverManager.getConnection( "jdbc:odbc:Mydsn","","" );
                               Statement st = con.createStatement();
                               ResultSet rs = st.executeQuery( "Select * from [Sheet1$]" );
                               System.out.println("sample:"+rs);
                                  ResultSetMetaData rsmd = rs.getMetaData();
                                  System.out.println("samplersd:"+rsmd);
                               int numberOfColumns = rsmd.getColumnCount();
                                  System.out.println("numberOfColumns:"+numberOfColumns);
                                   while (rs.next()) {
                                            System.out.println("sample1:"+rs);
                                            for (int i = 1; i <= numberOfColumns; i++) {
                                                 if (i > 1) System.out.print(", ");
                                                 String columnValue = rs.getString(i);
                                                 System.out.print(columnValue);
                                            System.out.println("");
                                       st.close();
                                       con.close();
                                      } catch(Exception ex) {
                                           System.err.print("Exception: ");
                                           System.err.println(ex.getMessage());
                        }

    1: What is the name of the excel sheet?
    2: What is printed in this program? null ? anything?
    error?Excel file name is "sample.xls" I set excel file connectivity in my JDBC driver(DSN). Here in my program I am not giving that excel file name. I am giving only that excel sheet name. that is followed
    ResultSet rs = st.executeQuery( "Select * from [Sheet1$]" );The output of this program is given bellow.
    sample:sun.jdbc.odbc.JdbcOdbcResultSet@1b67f74
    samplersd:sun.jdbc.odbc.JdbcOdbcResultSetMetaData@530daa
    numberOfColumns:2

  • How to read data from many excel files

    I'm aquiring data continusly from several sensors, and every days file name are changed. Data are saved on xls files.
    Now, I'd like to read every data from this files and put them in a waveform. How can I concatenate all files and read the values?

    You probably do not want to use a traditional waveform. LabVIEW has a Waveform Chart which inputs one point at a time. Waveform Graph inputs an array.
    I suspect that the data is stored in an array. You need to read the arrays in and build them into larger arrays. If your right click on the build array vi, you can select concantenate which will append one array to the end of the other. When you have built your giant array, just feed it to a waveform graph.
    If you need to see some example code, go to the advanced search page. It is at www.ni.com >> support >> advanced search (it is at the botton--click on the words). Enter excel read in the all the words field and search just the example programs. There were for hits.
    Jeremy Braden
    National Ins
    truments

  • How to read data from a .txt file?

    currently i'm under study on java
    while need to extract data from a hyperterminal or .txt file
    could any one help me in this problem.?
    as in txt or .ht got their own overhead .( or what u call it. tt identify the file type)
    so how to open it and read data one ah?
    thanks all.

    Here's a code snippet 4 u
    String sInput = null;
    FileInputStream sStream = new FileInputStream("yourTxtFile");
    BufferedReader fileIn = new BufferedReader(new InputStreamReader(sStream));
    while((sInput = fileIn.readLine()) != null){
    System.out.println(sInput);
    hope this help
    *-)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to read data from a .txt file in real time

    Hi
    I am running a fortran code which takes around 1 week to run and output data are continuously saved in .txt files. I want to display these data and plot it against time in labview.
    Lets say I have a array of real numbers starting from 1.0 , and every 2-3 sec another number is added (output of code). So I dont want end-of-file-reached error in my program and also want program to wait until next data is updated in .txt file.
    I tried to make a simple read_txt_file.vi, but I am getting problems in terms of continous reading. Help !! Help !!
    Pl see the attached vi.
    Thanx
    PKJ
    Attachments:
    FileReader.vi ‏43 KB
    labview.txt ‏18 KB

    Hi PKJ,
          I modified your VI and it seems to do what you asked, that is, display the data from a file as the data is being added.
    Hope it helps!
    Message Edited by Dynamik on 11-08-2005 04:32 PM
    Message Edited by Dynamik on 11-08-2005 04:34 PM
    When they give imbeciles handicap-parking, I won't have so far to walk!
    Attachments:
    FileReader.vi ‏52 KB

  • How to read data from the PDF file

    Hi
    i need pdf related API details and sample program to retrive the data from the pdf.

    Did you even try looking this one up yourself? Google "java pdf" and you get plenty of results. The first one looks pretty promising, and I'm sure there is plenty of documentation with the API.

  • How to read data from a text file

    I have saved a text file on my hard drive, and would like to read the file. Once read I would like to copy it to another file. I think I am suppose to use the BufferedReader, and FileReader classes. I am not sure what sequence to follow in order to do this. Could some one give me some feed back on what is needed, and in what sequence to perform this task?

    Where do I store my file within my Platform(Eclipe), in order to read or access the file. Whenever I use the declaration below. I get an FileNotFoundException. I understand the code, but am not sure where to store the file, so that the line of code below will recognize it..
    FileReader in = new FileReader("data1.txt");
              BufferedReader a = new BufferedReader(in);

  • How to read data from a file that was formatted by excel?

    Hi everyone, I'm familiar with java.io and the ability to read from files, can anyone tell me how to read data from a file that was formatted by excel? Or at least give me some web references so that I can learn about it?

    http://jakarta.apache.org/poi/hssf/index.html
    HSSF stands for Horrible Spreadsheet Format, but it still works!

  • How to read data from a zipped MS Access file?

    How to read data from a zipped MS Access file?

    RPJ,
    You do not need to use the Close Zip File.vi when you unzip a folder.  This VI is used when you are creating a zip folder.
    As for examples, I found a couple of ActiveX based MS Access examples.  These programs look to be pretty basic.  For more in depth example I would search Microsoft Developers Network
    http://zone.ni.com/devzone/cda/epd/p/id/2188
    http://zone.ni.com/devzone/cda/epd/p/id/1694
    Regards,
    Jon S.
    National Instruments
    LabVIEW R&D

  • How to read data from a file that is already open by another program

    Hey..
    I have made IV, where I'm trying to read data from a log file, that is being updated by another program while my IV runs.
    To be clear, this program writes data continuously to this file and I want to read from the file in LV at the same time.
    The problem is that LV reports an error when I'm trying to read the log file, even if I use to "read only" mode.
    I believe that the program that is producing the file, have some kind of lock on the file. I have tryed to copy the file and then reading from the copied file, but LV throws already an error when I try to copy the file.
    Has anyone tryed this, and found a solution.?
    Additional info: The program that produces the file is STM Studio 
    Best Regards
    Allan

    Hi Alha,
    when that file is locked by the other program you can't do anything about that - apart from quitting that other program. Probably this isn't an option to you…
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Read data from a text file, one line at a time.

    I need to read data from a text file, and display each line in a String Indicator on Front Panel. It displays each line, but I get Error 4, End Of Line, unless I enter an extra line of data in the file that I don't need. I tried Read From Text File.vi, made by Nat Instr, and it gave the same error.

    The Read from Text File.vi reads data from a text file line by line until the user stops the VI manually with the Stop button on the front panel, or until an error (such as "Error 4, End of file") occurs. If an error occurs, the Simple Error Handler.vi pops up a dialog that tells you which error occurred.
    The Read from Text File.vi uses a while loop, but if you knew how many lines you wanted to read, you could replace the while loop with a for loop set to read that many lines from the file.
    If you need something more dynamic because the number of lines in your files vary, then you could change the code of the Read from Text File.vi to the expect "Error 4, End of file" and handle it appropriately. This would require unbundling the error cluster that comes fro
    m the Read File function with the Unbundle By Name function, so that you can expose the individual error "status" and error "code" values stored in the cluster. If the value of the error "code" is 4, then you can change the error "status" from true to false, and you can rebundle the cluster with the Bundle by Name function. Setting the error "status" to false instructs the Simple Error Handler to ignore the error. Otherwise, pass the original error cluster to the Simple Error Handler.vi, so that you can see what the error is.
    Of course, if you're not interested in what the errors are, you could just remove the Simple Error Handler.vi, but then you wouldn't see any error messages.
    Best of Luck,
    Dieter
    Dieter Schweiss
    Applications Engineer
    National Instruments

  • How to load data from a  flat file which is there in the application server

    HI All,
              how to load data from a  flat file which is there in the application server..

    Hi,
    Firstly you will need to place the file(s) in the AL11 path. Then in your infopackage in "Extraction" tab you need to select "Application Server" option. Then you need to specify the path as well as the exact file you want to load by using the browsing button.
    If your file name keeps changing on a daily basis i.e. name_ddmmyyyy.csv, then in the Extraction tab you have the option to write an ABAP routine that generates the file name. Here you will need to append sy-datum to "name" and then append ".csv" to generate complete filename.
    Please let me know if this is helpful or if you need any more inputs.
    Thanks & Regards,
    Nishant Tatkar.

  • Read data from a log file to flex textarea while deploying

    Hi,
    I am new to flex. I am able to read data from a log file that placed in C drive and able to write that data into flex textarea, but I am unable to read the same file while it is deployed into weblogic sever.
    Could anyone please tell me how to solve this problem.
    Thanks,
    Sri.

    Do you have it trying to read that same file on your C drive or is the file actually deployed somewhere on the server?

  • Need to read data from a text file

    I need to read data from a text file and create my own hash table out of it. I'm not allowed to use the built in Java class, so how would I go implementing my own reading method and hash table class?

    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.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for

  • Installing Adobe Photoshop CS5 in Windows 7 Home Premium 64bit

    Hi, Just wanted to know if there are any problems installing Adobe Photoshop CS5 in Windows 7 Home Premium 64-bit? Planning to purchase a laptop that comes with the OEM license and plan to use 64-bit OS to maximize the 8GB RAM of memory. Just afraid

  • Over delivery tolerance value while creating delivery document

    Dear Gurus, I need your help for the below scenario, I have created a sales order for 25000 TO, Over delivery tolerance is 10 %.So logically speaking I can dispatch 27500 MT material. I have created 3 deliveries as below, 1st delivery for 23500 TO 2n

  • Down loaded Firefox but it won't connect to the internet

    Hello I'm new to Apple, Safari is fine but it isn't recognised by an online application I need to use on a regular basis. I downloaded FireFox, my old browser, but it will not go online, it opens but the address bar says "Go to web site" I type in th

  • Can i use chinese words in the iphoto ?

    can i use chinese words in the iphoto ?

  • Running sqlplus from an OWB process flow

    I have two SQLplus scripts that I need to run as part of a process flow. The flow calls the scripts at different moments, using Unix commands that look like sqlplus userid/passwd@sname @startReadseq.sql sqlplus userid/passwd@sname @idenTransac.sql Sc