How to avoid special characters( #) via Utl_file Package

Hello,
I am using UTL_FILE package in order to read the text from a text file and insert this text into a table.
But the text contain special character like #.
This is the nature of this text data.
For example the O/S text file contain the following text:
TEXT:
Name of the default schema being used in the current schema.
Name of the default schema being used in the current schema.
Name of the default schema being used in the current schema.
Name of the default schema being used in the current schema.
Name of the default schema being used in the current schema.
Name of the default schema being used in the current schema.
How should we avoid reading the following line via UTL_FILE from the text file?
So the text without these special characters will be inserted into a table.
I wanted that these special characters would not be inserted into a table via UTL_FILE.
What code I can add in my following routine in order to avoid the reading of special characters # or a following line from the text file?
Thanks
Sharbat
UTL FILE Code:
Declare                              
l_file_handle UTL_FILE.FILE_TYPE;                              
l_buffer VARCHAR2(4000);                              
BEGIN                              
l_file_handle := UTL_FILE.FOPEN('c:\temp', 'test.txt', 'r', 4000);                              
loop
UTL_FILE.get_line(l_file_handle,l_buffer);
insert into TEST (text) values(l_buffer);
end loop;
exception
when no_data_found then
UTL_FILE.FCLOSE(l_file_handle);
when others then
if utl_file.is_open(l_file_handle)
then
utl_file.fclose(l_file_handle);
end if;
end;

Hi,
in Forms you can use text_io for reading text from a file. For questions related to database packages I suggest to post this question on teh database forum here on OTN.
Frank

Similar Messages

  • How to Avoid Special Characters in string

    Hai.
    I want only Alphabets & Digits to be entered in to my string.No any other special characters except spaces.How can I do this? 
    Solved!
    Go to Solution.

    MikeS81 wrote:
    see the attached example.
    I would allow a few more, e.g. 0 and 8 to allow editing of the entered string (backspace, cursor buttons, delete key, etc.).
    Message Edited by altenbach on 11-21-2008 12:49 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    check_char_LV80MOD.vi ‏14 KB
    FilterStringInput.gif ‏6 KB

  • How to print Special Characters in Sap-Scripts

    How to print Special Characters in Sap-Scripts
    Thanks,
    Ravi

    Hi
    if u want print special characters we can use hot codes i.e '  '  (single inverted commas). in between these hot codes insert u r special characters.
    write    '    !@#$%^&*( )  '.
    for the above write statement output is
    output is   !@#$%^&*( )

  • How to write special characters in PDF using iText

    How to write special characters encoded with UTF-8 in PDF using iText.
    Regards,
    Pandharinath.

    I don't know what your problem is but that's almost certainly the wrong question to ask about it. Java (including iText) uses only Unicode characters. (You may consider some of them to be "special" if you like but Unicode doesn't.) And when it does that, they aren't encoded in UTF-8 or any other encoding.
    So can you describe your problem? That question doesn't make sense.

  • How to display special characters in Script...

    hi all,
    Can any one tell me how to display special characters in script...
    how to write in text element
    thanks in advance,
    prashant

    Hi Prashant ,
      What special characters would you like to include .
    There are a set of characters / icons /symbols that can be included in Script , for that open a window in edit mode and in the menu there will be an option called Insert  , here you can find a lot of characters/symbols that can be included .
    Regards,
    Arun

  • How to avoid special stock indicator for intercompany sales transitions.

    Hi Friends
    I have an issue Intercompany sales .if I  enter intercompany plant(Delivering plant) in the sales order system is taking special stock indicator and looking for sales order stock.
    If I enter company code plant for sales from unrestricted stock, system is not taking special stock indicator.
    Please advice how to avoid special stock indicator for intercompany sales transitions.
    Thanks in advance.
    SRK

    Ravi,
    Special stock is generally determined by the MRP strategy group in the material master of the plant against which you place your order.  The strateg(ies) contained in the strategy group will determine the SO requirements type, which will in turn determine whether or not the order is 'account assigned' (special stock).  
    It is normal to only have one strategy contained in a strategy group.  However (and I seldom recommend this) SAP will support multiple strategies within one strategy group.  In this case, you could have both MTS and MTO orders against the same plant/material, by manually altering the requirements type in the sales order.  This scenario is usually difficult for a planner, and involves additional manual attention to make everything work.
    I suggest that your first avenue is to change the Strategy group in the material master of the delivering plant to one that supports MTS.  This has a big impact in Controlling and in Production Planning, so ensure that all affected functional groups are aware of what you are doing, and of the resulting changes that they will experience.  The transition from MTO to MTS must be carefully controlled.
    If you are not a PP expert, I suggest you consult with your local PP expert before embarking on this change.
    Best Regards,
    DB49

  • How to remove special characters while typing data in edit cell in datagrid in flex4

    Hi Friends,
    I am facing this problem "how to remove special characters while typing data in edit cell in datagrid in flex4".If know anyone please help in this
    Thanks,
    Anderson.

    Removes any characters from
    @myString that do not meet the
    provided criteria.
    CREATE FUNCTION dbo.GetCharacters(@myString varchar(500), @validChars varchar(100))
    RETURNS varchar(500) AS
    BEGIN
    While @myString like '%[^' + @validChars + ']%'
    Select @myString = replace(@myString,substring(@myString,patindex('%[^' + @validChars + ']%',@myString),1),'')
    Return @myString
    END
    Go
    Declare @testStr varchar(1000),
    @i int
    Set @i = 1
    while @i < 255
    Select
    @TestStr = isnull(@TestStr,'') + isnull(char(@i),''),
    @i = @i + 1
    Select @TestStr
    Select dbo.GetCharacters(@TestStr,'a-z')
    Select dbo.GetCharacters(@TestStr,'0-9')
    Select dbo.GetCharacters(@TestStr,'0-9a-z')
    Select dbo.GetCharacters(@TestStr,'02468bferlki')
    perfect soluction

  • How to query the data using control item avoiding special characters

    I had a small doubt in d2k.
    i created a emp block
    in that we r providing a control item for empno
    i am using that control item for querying emp details based on that control item value.
    if i am giving single quote in that control field it is querying for all the records in the emp block
    i am providing the where clause like this
    'empno like '||''''||:m_empno||''''
    can u pls clear this doubt for me.
    thanks in advance.

    one thing i forgot to add.
    we shouldnt use ascii values for the special characters.
    means we shouldnt use ascii values for restricting the sspecial characters.
    pls get me the reply as soon as possible
    thanq

  • How to handle special characters in Apex

    Hi ,
    In my application I have two regions - one is Report Region (Interactive Report) and other one is HTML region with two text items - Empno and name
    My Report has two columns Empno(varchar2) and Ename(varchar2).
    When I click the edit link in the report column, the empno should have a read only EMPNO value and ename is a text field with ENAME value.
    When I run my application I have encountered the following problems :
    1. if my empno has special characters like ' # ', the characters after that is not getting displayed
    2. if my empno has special characters like ',' - the characters after comma is treated as a next texitem value
    Here is my credential ,
    Workspace CTSAN_ORACLE_DB
    Username [email protected]
    Password lakshmi321
    URL : http://apex.oracle.com/pls/apex/f?p=9444:19:4292839314890159:::::
    Plz. suggest me how to rectify the above problems.
    Thanks,
    Anoo..
    Edited by: Anoo on Aug 13, 2010 3:05 AM

    Don't pass data values in URLs. Whilst it is possible to escape values to make them URL- and APEX parameter-safe, it is much better practice to avoid the problem altogether.
    Create a surrogate primary key on the table that is an immutable discrete numeric identifier and only use this as a URL parameter. In target pages/regions, use this PK value to retrieve the required data from the table.

  • How to handle special characters in Stage web view with Load URL method?

    Hi,
      I have Latin special characters in my text. My HTML content contains the text as well as the image. If I use stage webview LoadString,  images will not be displayed. But my latin characters are displayed correctly.
    If I use LoadURL method, the images are displayed correctly but I have problem in displaying the latin special characters. How to solve this issue?

    Don't pass data values in URLs. Whilst it is possible to escape values to make them URL- and APEX parameter-safe, it is much better practice to avoid the problem altogether.
    Create a surrogate primary key on the table that is an immutable discrete numeric identifier and only use this as a URL parameter. In target pages/regions, use this PK value to retrieve the required data from the table.

  • How to handle special characters in NWDI

    Dear All
    I am trying to update the Description from JSP form. Through JCO we are calling the RFC of ABAP. We are passing these description from Java to RFC of ABAP and this RFC update the text in Database.
    We have noticed that if there is some special character in description like as : š or ž, complete description is not getting updated in to the SAP database.
    Can anyone help me how to handle these special characters in Java. There may be N number of special characters. We want to generalize it. We want to replace these characters by s and z respectively.
    For example : We want to update this description.
    APPLERR H'4301 H'FA03 H'254C na Zagreb TC4 riješen je cleaning procedurom, te je i kroz CSR odgovoreno da trap korekcija N01TCADG-0052 u bloku UPDC više nije potrebna, te se može izbaciti (AP143).
    Uspješno su završene HR17/CN-A3 FOA-e na tranzitnom nivou, te slijedi roll-out u dva termina 12/13.04 i 19/20.04. ETK je na sastanku isporu&#269;io SW, te ALEX i mini PLEX za sve objekte.
    AP147. Poslati finalnu dokumentaciju za uvo&#273;enje paketa (implementacijsku instrukciju i sve popratne datoteke).
    WHile updated text is as follows :
    APPLERR H'4301 H'FA03 H'254C na Zagreb TC4 rije
    N01TCADG-0052 u bloku UPDC vi
    Uspje
    sastanku isporu
    AP147. Poslati finalnu dokumentaciju za uvo
    Regards
    Bhavishya

    Hi Bhavishya,
    Apparently your SAP database isn't configured to support Unicode. That would be the first solution to your problem, but I can imagine it's a bit drastic to convert your DB.
    A second solution would be to encode the input description to ASCII before storing it in the database. When reading from the database, decode again to Unicode. This way, no information is lost. A suitable encoding would be Base64. e.g.
    String description = "šunday žebra";
    String descriptionBase64 = new sun.misc.BASE64Encoder().encode(
      description.getBytes("UTF-8")); // ""
    // store descriptionBase64 in the DB
    // later, when reading descriptionBase64 from the DB
    String description2 = new String(
      new sun.misc.BASE64Decoder().decodeBuffer(descriptionBase64), "UTF-8");
    Instead of using Sun's implementation, a better alternative is to use the open source implementation
    org.apache.commons.codec.binary.Base64 from Commons Codec . 
    The 3rd approach is indeed to normalize the description by replacing all special characters with their ASCII equivalent. A rather easy solution is as follows:
    String description = "šunday žebra";
    String descriptionNormalized = sun.text.Normalizer.normalize(
      description, sun.text.Normalizer.DECOMP, 0).replaceAll(
      "[^p{ASCII}]", "");
    sun.text.Normalizer decomposes the string, e.g. "éàî" becomes "e´a`i^", after which non-ASCII characters are being removed using a regular expression.Again, note that it's usually a bad idea to use sun.* packages, see note about sun.* packages. The above code only works with J2SE 1.4 and J2SE 5.0, but it breaks in J2SE 6.0 (where
    java.text.Normalizer became part of the public API ;-). A good open source implementation can be found here: ICU4J (com.ibm.icu.text.Normalizer). 
    Kind regards,
    /Sigiswald

  • How to add special characters in Flash CS3

    Hi, i need the help of some flash guru… these last weeks we were working with cloversites.com to build a community website… the interface is awesome etc etc however we in Malta have eight special characters (GCZ with a dot on top of them and an H with a second strikethrough). Those at cloversites wrestled with the problem, they could see the characters on their computers but when they entered the text in the site, flash couldn't render the special characters. Here is their message:
    I am extremely sorry about this, but we were unable to add in your characters. We attempted to add them into our software but they did not work. We worked on it all morning and realized that we need an extra add-on for our keyboards. Adding special characters is nothing new to us and have answered this request for many of our international users. For some reason, the Maltese characters did not work in our sites. For example, our "option-G" is the copyright symbol so it will need to be transferred over to international characters.
    Unfortunately, we thing that this has to do with Adobe Flash CS3. The software allowed me to embed the characters, but we were unable to render them on the web. Which led us to think it had to do with the version Adobe is running and its inability to render the text through its software on the web. None of the characters worked on the web, and it looks like its just an Adobe bug. So we are able to type and use the Maltese characters, but Adobe Flash is having trouble with them.
    Does anybody know of any possible solution?

    see if codepoints-to-string() is suitable for you ..
    Re: how to concatenate hexadecimal value to string in XQuery in PS Message Flow

  • How to remove special characters in xml

    Dear friends,
    How to remove the special character  from the xml. I am placing the xml file and  fetching through file adapter.
    The problem is when there is any special character in xml. i am not able to pass to target system smoothly.
    Customer asking schedule the file adapter in order to do that the source xml should not have any special charatcters
    How to acheive this friends,
    Thanx in advance.
    Take care

    Hi Karthik,
    Go throgh the following links how to handle special character
    https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42
    Restricting special characters in XML within XI..
    Regards
    Goli Sridhar

  • How to preserve special characters in dynamic textfield for text comparison?

    The problem is as follows:
    Since I mostly develop for multiple languages I am forced to have dynamic textfields in my buttons which contain three lines (to account for the differnt text.lengths in different languages).
    I then populate the textfields with strings out of an array or xml and use the textfields contents later in my button class to execute different code depending on the textfields content.
    This works fine as long as I don`t use any special characters, like for example "\n".
    var labels:Array = ["\nLABEL1","LABEL\n\n2"];
    switch (e.currentTarget.txt.text)
                    case labels[0]:
                        doSomething();
                        break;
                    case labels[1]:
                        doSomethingElse();
                        break;
    shows the right thing in the button label (breaks the text were I want it)
    but stops to work
    (with htmlText &  <br> its the same)
    my workaround for the moment is to use filler spaces,
    var labels:Array = ["                   LABEL1","LABEL                                                                        2"];
    but that`s obviously ugly to setUp and requires a lot of trial/error to get it right for all languages.
    Any ideas how to bypass that?

    Bad habits die hard ;-)
    Weird enough spelling the problem out and getting this response from you cleared my head and  I finally got an easy solution.
    I simply attach a dynamic property to the movieclip, copy the array contents into them and instead of using the text-property for comparison I compare the MovieClips fresh created spectext property.
    Voila: Now I can be lazy without too much of a bad conscience.

  • How to find Special Characters in a single query

    Dear Experts,
    Your usual help is required to solve the query.My query is "How to find all special characters like (%$*&@,;'/+- etc. in a single query?"
    Thanks.
    e.g.
    A_MIR
    A%SIM
    A*SIM
    A)SIM

    Hi,
    947459 wrote:
    Dear Experts,
    Your usual help is required to solve the query.My query is "How to find all special characters like (%$*&@,;'/+- etc. in a single query?"
    Thanks.
    e.g.
    A_MIR
    A%SIM
    A*SIM
    A)SIMIt's not clear what you want.
    What are "special characters"? Can you list all of them?
    Do you want to find rows where string_column contains any of the special characters? If so
    SELECT     string_column
    FROM     table_x
    WHERE     string_column     != NVL ( TRANSLATE ( string_column
                                        , 'A(%$*&@,;'/+-'
                                , 'A'
                          , 'A'
    ;I assume 'A' is not a special character.
    You could also use regular expressions, but it will be more efficient if you don't use them unless you really need to.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements), and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}
    You'll get better replies sooner if you always include this information whenever you have a question.

Maybe you are looking for

  • Opening Balances for GO live

    We wish to GO Live on a particular date. However the opening balance before that particular date are still under verification, but still we are having values of opening balances will be corrected say in next 20 to 25 days after the date of go live. P

  • Repaired screen and now iPod won't play

    I replaced the broken LCD screen in my son's 1st gen black nano. It looks beautiful! There is a problem with the ipod now though. The iPod won't play. Everything works perfectly...screen is bright and beautiful, click wheel works to move through all

  • Since upgrading to 3.0, I am not able to synch with iTunes.

    Can't synch, can only download photos. The computer does not recognize my phone, but it recognizes my other iPod, using the same cord and USB ports. I have a MacBook. Tried installing latest version of iTunes, Tried restarting computer, etc. All I ge

  • Some problems about payroll

    Thanks every body! I want to ask you some questions. - The first, I want to build base pay = base salary grade * coefficient of pay. oh where do I enter base salary grade and coefficient of pay? - Second, now i want to develop new pay system. how do

  • Acrobat Reader XI and Acrobat 8 prof

    Running windows 7 64 bit with Adobe Reader XI and on same pc Acrobat Prof. 8 is also installed. When opening a pdf in explorer the following comes: "Cannot use Adobe reader to view pdf in your web browser. Reader will not exit. Please exit your brows