Read Plain-Text vom Upload File

Hi,
i have the following file :export.txt:
Content: Hello World
It´s upload to the XDB-Server => /marco/export.txt
When i try to read from this file, i got the following result:
SQL> SELECT extract(res, '/Resource/Contents/text').getClobVal() xml_doc
2 FROM resource_view
3 WHERE any_path = '/marco/export.txt';
XML_DOC
<text xmlns="http://xmlns.oracle.com/xdb/XDBResource.xsd">Hello World</text>
I would like to have only "Hello World". What can i do ?
Thanks in advance
Marco

Sorry but this dosn´t work for me. I uploaded my alert.log File and i tried to read it...
SELECT path FROM PATH_VIEW
WHERE UNDER_PATH(res, '/marco/', 1) > 0
/marco/export.txt
/marco/alert.log
SQL> select xdburitype('/marco/alert.log').getClobVal() from dual;
select xdburitype('/marco/alert.log').getClobVal() from dual
FEHLER in Zeile 1:
ORA-00904: "SYS"."XDBURITYPE"."GETCLOBVAL": ungültiger Bezeichner
SQL> SELECT extractvalue(res, '/Resource/Contents/text').getClobVal() xml_doc
2 FROM resource_view
3 WHERE any_path = '/marco/alert.log'
4 ;
SELECT extractvalue(res, '/Resource/Contents/text').getClobVal() xml_doc
FEHLER in Zeile 1:
ORA-22806: Kein Objekt oder REF
What is the usual way to transfer text or binary files from xdb to a table ?
Thanks
Marco

Similar Messages

  • Reading long text from excel file to an internal table

    Hi
    Can any body tell me how to read long text from excel file to an internal table.
    When i am using this FM KCD_EXCEL_OLE_TO_INT_CONVERT then it is reading only 32 characters from each cell.
    But in my excel sheet in one of the cell has very long text which i need to upload into a internal table.
    may i know which FM or what logic i need to use for this problem.
    Regards

    Hi,
    Here is an example program.  It will upload an Excel file with two columns.  You could also assign the Excel structure dynamically, but I wanted to keep the example simple.  The main point is that the internal table (it_excel in this example) must match the Excel structure that you want to convert.
    Remember, this is just an example to help you figure out how to properly use the technique.  It will certainly need to be modified to fit your requirements, and as always there may be a better way to get the Excel converted... this is just one possibility that has worked for me in the past.
    *& Report  zexcel_upload_test                            *
    REPORT  zexcel_upload_test.
    TYPE-POOLS: truxs.
    TYPES: BEGIN OF ty_excel,
             col_a(10) TYPE n,
             col_b(35) TYPE c,
           END OF ty_excel.
    DATA: l_data_tab         TYPE TABLE OF string,
          l_text_data        TYPE truxs_t_text_data,
          l_gui_filename     TYPE string,
          it_excel           TYPE TABLE OF ty_excel.
    FIELD-SYMBOLS: <wa_excel>  TYPE ty_excel.
    PARAMETERS: p_file TYPE rlgrap-filename.
    * Pass the file name in the correct format
    l_gui_filename = p_file.
    * Upload data from PC
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename                = l_gui_filename
        filetype                = 'ASC'
        has_field_separator     = 'X'
      CHANGING
        data_tab                = l_data_tab
      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 ...
      EXIT.
    ENDIF.
    * Convert from Excel into the appropriate itab
    l_text_data[] = l_data_tab[].
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
      EXPORTING
        i_field_seperator    = 'X'
        i_tab_raw_data       = l_text_data
        i_filename           = p_file
      TABLES
        i_tab_converted_data = it_excel
      EXCEPTIONS
        conversion_failed    = 1
        OTHERS               = 2.
    IF sy-subrc <> 0.
    *   MESSAGE ...
      EXIT.
    ENDIF.
    LOOP AT it_excel ASSIGNING <wa_excel>.
    *  Do something here...
    ENDLOOP.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      PERFORM filename_get CHANGING p_file.
    *       FORM filename_get                                             *
    FORM filename_get CHANGING p_in_file TYPE rlgrap-filename.
      DATA: l_in_file  TYPE string,
            l_filetab  TYPE filetable,
            wa_filetab TYPE LINE OF filetable,
            l_rc       TYPE i,
            l_action   TYPE i,
            l_init_dir TYPE string.
    * Set the initial directory to whatever you want it to be
      l_init_dir = 'C:\'.
    * Call the file open dialog without multiselect
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title            = 'Load file'
          default_extension       = '.XLS'
          default_filename        = l_in_file
          initial_directory       = l_init_dir
          multiselection          = 'X'
        CHANGING
          file_table              = l_filetab
          rc                      = l_rc
          user_action             = l_action
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          OTHERS                  = 4.
      IF sy-subrc <> 0.
        REFRESH l_filetab.
      ENDIF.
    * Read the selected filename
      READ TABLE l_filetab INTO wa_filetab INDEX 1.
      IF sy-subrc = 0.
        p_in_file = wa_filetab-filename.
      ENDIF.
    ENDFORM.                    " filename_get
    Regards,
    Jamie

  • Plain text ASCII format file

    This may be slightly off-topic, but I'm hoping maybe someone knows the answer:
    I received a license for the Messiah animation suite as part of a one-time offer, and it says to paste the License text "into a text file... (this file must be a plain text ASCII format file, NOT Rich Text or doc)."
    I have Microsoft Office 2008. It has a Plain Text (.txt) format, but googling there seems to be some uncertainty if in Mac it is plain text ASCII format. The TextEdit app I'm not sure of either I'm pretty sure isn't.
    Anyone got a solution?
    Thanks!

    The problem is whether that version of .txt or the MS Office 2008 is actually ASCII format or unicode.
    I don't think that is the issue, since ascii and unicode are identical for the usual 26 letters and 10 digits that are probably in the license text. The point is that it be .txt and not .doc or .rtf or .html, which has all kinds of other junk added to the real content. I would use TextEdit set to Plain text.

  • Read the text in pdf file

    Dear all,
    I have checked a lot of post about reading pdf in this forum. However, is it possible to read the text in pdf file. In my case, I need to read the content of pdf to do further process. Could anybody give me some suggestions. Thank you.

    I have a similar problem, can anybody help us....

  • Password displayed in plain text in sql file

    Hi all,
    I have a shell script that calls another sql file to connect to the database and do some queries. The username and password used to connect to the databse are in plain text in the sql file. My question is how can I hide these parameters in the sql file and be able to connect to the database.
    Thanks in advance.

    Oracle have something to do such thing : Secure External Password Store
    Laurent Schneider posted an example of usage on his blog : sqlnet.wallet_override=true
    Or you have an external tool : Oracle Password Repository which seems easy to use.
    Nicolas.

  • May ID isolate tables from plain text in a file?

    In a big Word file it seems necessary to isolate the tables from the rest of paragraphs.
    Unfortunately the body style applied to both is the same style.
    Have tables some formatting element to get only them?

    Yes, a new thread...
    Just we have a huge file with text and tables and need to place the tables at the end of the book. Just the tables. Plain text at the beginning.
    Import options for text surely allows to place only text (unchecking graphs)  but it is not an option to place only graphics, as far as we tried in the menu.*
    Thank you.
    *Furthermore, the Word brings the same style applied to tables and text... Book has to be managed in two parts.

  • How to read the contents of Uploaded File Data?

    Dear Experts,
    I want to develop one webdynpro application in which the iview contains the FileUpload option.and after uploading i need to read the contents of the file.
    Can you plz guide me how to achieve this?
    its very much helpfull if u have any sample project / code on this...plz do send it to [ycsvissu at gmail dot com]
    Regards,
    Viswes.

    Ike,
    Do you have a sample. I am searched so much in this forum for samples. I looked on SAX Parser. I did not find any samples.
    Please help me.
    Thank you for your posting.
    Padma.

  • Reading pdf, text and docx file

    Dear sir
    i have different files (pdf, txt and docx)in a directory. I want to read them all and search in them for specific contents. Please is there any API exists with documentation to read pdf files and suggest me some procedure of doing it.
    Thanks.

    Muhammad Umer wrote:
    Dear sir
    i have different files (pdf, txt and docx)in a directory. I want to read them all and search in them for specific contents. Please is there any API exists with documentation to read pdf files and suggest me some procedure of doing it.
    Thanks.For reading the text content from PDF files I have had moderate success with the PDFBox library. docx is an XML format, so you can use a SAX parser to read those. Search for "java docx" using Google to get some hints. There is also the Apache POI project, but the Word support in that API is sketchy at best; the project page openly admits that it is not actively developed.

  • Read timed out while uploading file via CAF webservice

    Hi there,
    I am trying to upload an xml file from a Web Dynpro application via webservice.
    Web Dynpro:
    public void importFile( )  {
        //@@begin importFile()
           try {
                   wdContext.currentImportFileElement().setFileName(wdContext.currentContextElement().getFileUploadUI().getResourceName());               
                     wdContext.currentImportFileElement().setFileBase64Binary(getByteArrayFromResource(wdContext.currentContextElement().getFileUploadUI()));                 
                   wdContext.currentRequest_ImportFileElement().modelObject().execute();
                   msgMgr.reportSuccess(wdContext.currentImportFileResponseElement().getMessage());          
                } catch (FileNotFoundException e) {
                   e.printStackTrace();
                   msgMgr.reportException(e.getLocalizedMessage());
                } catch (IOException e) {
                   e.printStackTrace();
                   msgMgr.reportException(e.getLocalizedMessage());
                } catch (WDWSModelExecuteException e) {
                   e.printStackTrace();
                   msgMgr.reportException(e.getLocalizedMessage());
        //@@end
    getByteArrayFromResource:
    private byte[] getByteArrayFromResource(IWDResource resource)
    throws FileNotFoundException, IOException {
    InputStream in = resource.read(false);
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    int length;
    byte[] part = new byte[10 * 1024];
    while ((length = in.read(part)) != -1) {
    out.write(part, 0, length);
    in.close();
    return out.toByteArray();
    in CAF:
    InputStream is = toInputStream(fileBase64Binary);
    private InputStream toInputStream(byte[] fileBase64Binary) {               
              InputStream is = null;          
              try {               
                   ByteArrayInputStream bais = new ByteArrayInputStream(fileBase64Binary);     
                   is = bais;               
              } catch (Exception e) {
                   e.printStackTrace();
              return is;
    Anybody could help me with this issue? Is there a better way to upload the file (about 4-10MB) via a webservice? Special settings for the webservice?
    Regards

    I dont use IBM's ftp library, but I do know networking.
    It seems either IBM got the protocol wrong (not going to happen) or (more likely) the socket being used has timedout due to inactivity (no input to read), that means a few things.
    1. Are you calling the methods in the correct sequence?
    If you have a protocol that needs you to login first, then send files and you just send the file first, this
    will cause an error.
    2. Sockets have java.net.SocketOptions associated with them: Check the socket settings for SO_LINGER, SO_TIMEOUT.
    If you set the SO_TIMEOUT to 0, you will have an idefinite socket connection (persistent connection). But, remember if the server has nothing to send, their simply is nothing to send
    and so you should NOT being trying to read an empty input stream.
    3. Closing: Are you closing the connection/streams anywhere other than where it should be done.
    Hint: Closing a connection is the last thing to do.
    Happy hunting, and remember Duke Dollars to me is like an answered question to you.

  • How to Read the "text file and csv file" through powershell Scripts

    Hi All
    i need to add a multiple users in a particular Group through powershell Script how to read the text and CSV files in powershell
    am completly new to Powershell scripts any one pls respond ASAP.with step by step process pls
    Regards:
    Rajeshreddy.k

    Hi Rajeshreddy.k,
    To add multiple users to one group, I wouldn't use a .csv file since the only value you need from a list is the users to be added.
    To start create a list of users that should be added to the group, import this list in a variable called $users, the group distinguishedName in a variable called $Group and simply call the ActiveDirectory cmdlet Add-GroupMember.
    $Users = Get-Content -Path 'C:\ListOfUsernames.txt'
    $Group = 'CN=MyGroup,OU=MyOrg,DC=domain,DC=lcl'
    Add-ADGroupMember -Identity $Group -Members $Users

  • How to read in text string pairs from an external txt file?

    I have an external txt file containing 26000 pairs of strings in the format
    string1a   string1b
    string2a   string2b
    string26000a string26000b
    all strings are always 4 characters in length.  For example,
    a123   jkdh
    b456   uusp
    How can use TestStand 2013 to input this data into local string array varaibles?  I also have legacy testers running TestStand 3.5, so I need a TestStand 3.5 solution as well.  Thanks in advance for any ideas.  Hopefully this can be done in TestStand without the use of LabView or LabWindows/CVI.

    Daniel E., thanks for the reply. 
         It is very frustrating to have to implement workarounds in order to access text in an external file when using TestStand.  TestStand already reads in text ini files, so it would probably take a TestStand software developer all of 1/2 day to write the code and 1/2 day to debug it.  Here I will restate the obvious.  Engineers have to deal with data, sometimes data generated from other applications.  Sharing data in a text file is one of the most basic functions (and one of the easiest to implement).  When I think of all the effort needed to support ActiveX, but NI did not see it fit to give TestStand users simple text file read/write functionality, it does not make sense to me.  Maybe it was too simple or mundane a task so it did not get developed?  Whatever the reason, I think users of TestStand deserve this basic functionality.
         Even if TestStand cannot read the data directly into array variables, it should provide some mechanism to read the text from the file, either line by line or all file text into a string, so the data could then be parsed into the array variables I need.
         I will pursue a CVI or LabView solution.  Please also know that I am not directing these comments at you, I do appreciate your reply.
    Regards,
    Ron

  • Unable to change font color for Plain Text Emails

    I have a Win7 Enterprise x86 machine running Outlook 2010.  I am unable to read plain text emails.  When I go into Options->Mail->Stationary and Fonts, the preview box under "Composing and reading plain text messages" is all white. 
    I've tried changing it to automatic, black, random colors, different fonts and styles, click 'Ok' and nothing happens.  Preview pane and incoming plain text emails are white.  I followed all the steps in this TechNet article: http://social.technet.microsoft.com/Forums/office/en-US/0e535f1f-0a2f-4208-9b05-42c4e943b484/outlook-2010-cannot-view-plain-text-emails?forum=officeitproprevious
    Applied the Fix It, repaired Office 2010, renamed the normalemail.dotm file.  Still nothing.
    Anyone run into this issue or have a fix?

    This could be a view issue. Please try to open Outlook using the /cleanviews
    switch to clean your views, and try again. Here is the line switches for Outlook 2010http://office.microsoft.com/en-001/outlook-help/command-line-switches-for-outlook-2010-HP010354956.aspx
    If /cleanviews doesn't work for you, you might try to recreate your Outlook profile. Please refer to this article:
    http://office.microsoft.com/en-us/outlook-help/create-an-outlook-profile-HA102749460.aspx
      

  • Show plain text in IIS..

    Hi, I'm a novice in JWS..
    I'm testing Java Web Start in IIS (windows 2000 server)..
    After needing MIME type as inputing
    "application/x-java-jnlp-file" with file type "jnlp"..
    Explorer show the plain text of jnlp files...
    what's wrong with it??
    What's need to set up Java Web start Server???
    (Maybe server need to set XML parsing???)
    In my case, I set up my server with only MIME type in IIS...
    Thanks to reading.. ugly writing... ^^
    I hope your help...
    [email protected]

    You may need a restart.
    I am using it with win2k and apache, and once I restarted apache that problem went away.

  • How to get plain text out of a multi line text field in Client Side Object Model?

    I am trying to read plain text from a MultiLineTextField in a List. This is how my code looks so far:
    //Get connection
    ClientContext context = new ClientContext("URL");
    Web site = context.Web;
    context.Load(site);
    context.ExecuteQuery();
    //Get list collection
    ListCollection lists = context.Web.Lists;
    context.Load(lists);
    context.ExecuteQuery();
    //Get specific list
    List menu = lists.GetByTitle("menu");
    CamlQuery camlQuery = new CamlQuery();
    camlQuery.ViewXML = "<View/>";
    ListItemCollection dishes = menu.GetItems(camlQuery);
    context.Load(menu);
    context.Load(dishes);
    context.ExecuteQuery();
    //Iterate through all dishes
    foreach(ListItem dish in dishes)
    Console.WriteLine("Dish: {0}:", dish.FieldValues["Name"]);
    Console.WriteLine("Price: {0}:", dish.FieldValues["Price"]);
    //Here I get my problem
    Console.WriteLine("Ingredients: {0}:", dish.FieldValues["Ingredients"]);
    In the last line where I try to read the ingredients, I am reading from a MultiLineTextField which is set to RichText. It is also supposed to stay in RichText format, as hyperlinks are supposed to be added there. The problem is that the output not only contains
    div-tags but also some weird question marks I never added to the field. I am trying to solve this issue for a couple of days now but it seems that there are only two possible solutions.
    Set the field from RichText to PlainText, which is not an option in my case.
    Use Regex to remove the div-tags. Please do not suggest this option. Mainly because I do not consider this to be a clean solution for this issue. Plus, I tried it and it removes the tags but those weird question marks stay.
    There seems to be a third option I found
    here. It is also mentioned in this
    question and it seems to work. But I can not get it to work for me. This is how it looks:
    string myString = item.FieldMultiLineText[Field_Name];
    So I wonder what is item supposed to be here? I suppose it is not a
    ListItem because in my case it does not offer a FieldMultiLineText-property.
    A short, informative code snippet would be great if you decide to help me with this issue.
    Thanks in advance.
    Algorithmen und Datenstrukturen in C#:
    TechNet Wiki

    Thank you for your reply. Unfortunately ListItem does not contain a definition for the Fields method.
    Algorithmen und Datenstrukturen in C#:
    TechNet Wiki
    You need to use the Microsoft.SharePoint class library and then use the sharepoint version of all the list objects you are using. See below.
    //Get connection
    ClientContext context = new ClientContext("URL");
    Web site = context.Web;
    context.Load(site);
    context.ExecuteQuery();
    //Get list collection
    SPListCollection lists = context.Web.Lists;
    context.Load(lists);
    context.ExecuteQuery();
    //Get specific list
    SPList menu = lists.GetByTitle("menu");
    CamlQuery camlQuery = new CamlQuery();
    camlQuery.ViewXML = "<View/>";
    SPListItemCollection dishes = menu.GetItems(camlQuery);
    context.Load(menu);
    context.Load(dishes);
    context.ExecuteQuery();
    //Iterate through all dishes
    foreach(SPListItem dish in dishes)
    Console.WriteLine("Dish: {0}:", dish.FieldValues["Name"]);
    Console.WriteLine("Price: {0}:", dish.FieldValues["Price"]);
    //Here I get my problem
    SPFieldMultiLineText multilineField = dish.Fields.GetField("Ingredients") as SPFieldMultiLineText;
    string ingredients = "";
    if (multilineField != null)
    ingredients = multilineField.GetFieldValueAsText(dish["Ingredients"]);
    Console.WriteLine("Ingredients: {0}:", ingredients);}
    I hope this helps
    Alex

  • How can I read the bootstrap files and extract the fragment-URLs and fragment-numbers in plain text?

    How can I read the bootstrap files of any HDS Live stream and extract the fragment-URLs and fragment-numbers in plain text?
    Could it be that it is some kind of compressed format in the bootstrap? Can I uncompress it wirh  f4fpackager.exe? Could not find any download for f4fpackager.exe. I would prefere less code to do so. Is there something in Java of JavaScript, that can extract the fragment-numbers?
    Thank you!

    Doesn't sound too hard to me. Your class User (the convention says to capitalize class names) will have an ArrayList or Vector in it to represent the queue, and a method to store a Packet object into the List. An array or ArrayList or Vector will hold the 10 user objects. You will find the right user object from packet.user_id and call the method.
    Please try to write some code yourself. You won't learn anything from having someone else write it for you. Look at sample code using ArrayList and Vector, there's plenty out there. Post in the forum again if your code turns out not to behave.

Maybe you are looking for

  • Is this a bug in PS CS6?

    whenever i try making a 3d object orbit around another, it freaks out : Photoshop Orbit - YouTube but i asked about it in general discussions and i was pointed to this video : How to Create rotating planets and moons in Photoshop « Photoshop in which

  • Left Outer Join

    I have tables with index on it , i join them using left outer join. So the table access path choosen by the optimizer is full table access. index not used in it. is there any other way to use index ? alternate to left outer join to use index ? thanks

  • Question to BADI: WORKORDER_INFOSYSTEM

    Hi, we use the BADI: WORKORDER_INFOSYSTEM with method: AT_OUTPUT_SCREEN for changing print layout. Now we want to use this badi to change the value of the output. Normaly the materialtext in show in german. But if the user has as special parameter.id

  • X-axis chart

    I am having trouble clearing a chart that read in a waveform from a analog daqmxbase read vi. I wired an empty array to the history node of the chart. It clears the the waveform on the chart, but it does not reset x-axis values to zero. It keeps star

  • Procedure or package

    regarding execution matter which one is faster procedure or package and why