Cut out white space from a text field (I give the points of response as candy!)

Hello

I need to cut all the white space characters that occur before and after all no white space in a text field.
By white space, I mean:
-space chr (32)
-chr (9) horizontal tab
-line break Chr (10)
-return Chr (13)

So, using this example:
CREATE TABLE test (
id NUMBER,
value VARCHAR2(100));

INSERT INTO test (id, value) values (1, chr(32)||chr(9)||chr(13)||chr(10)||'a'
||' '||'b'||chr(10)||'c'||chr(13)||chr(10)||chr(32)||chr(9)||chr(32));
I need to end up with:
a space b linefeed c
So I want to get rid of the white space beginning and end, but keep the white space inside the string.

I can't do it with the TRIM function alone. I could do many iterations of replace the spaces with something bind ' # ' and then cut it, but the characters of white space can be in any order.

I tried
REGEXP_REPLACE(value, '[^:space:]')
but that does not give a correct result.

Use the trim (regexp_replace ("(\S+) \s* \s*','\1", value)):

select  id,
        '[' || value || ']' val,
        '[' || trim(regexp_replace(value,'\s*(\S+)\s*','\1 ')) || ']' new_val
  from  test
/

        ID VAL                            NEW_VAL
---------- ------------------------------ ------------------------------
         1 [                                [a b c]
           a b
           c
                 ]

SQL> 

SY.

Tags: Database

Similar Questions

  • Is it possible to create an Advisory Committee would be email address from a text field that connects to a button "submit"?

    I was told that I must submit this question to the forum script... I wonder if this is possible in Acrobat, because so far I was not able to do, but a customer wants that one:

    I have a 'Submit Request' button that includes the e-mail addresses of the intended recipients of a PDF form. But the customer also wants the person who fills out the form to be cc would be in the email that is sent to other recipients. Then the area where the person enters their email address on the form, is it possible to have somehow this email address appear in the cc a section of the email that is sent when the person reaches the 'submit request' at the bottom of the form?

    As far as I can see, the only way to get the form by e-mail to anyone is to the list of previously selected addresses in the section actions of the submit button. That's why I was not able to understand how to get an email address at random from a text field to also be cc would

    Hope this has meaning and any help is very appreciated.

    Thank you!

    So that the drive to send the complete PDF, the document must be enabled for the drive. This gives the document certain usage rights that allow the reader to do things that he cannot normally, including saving a form updated the. To do this:

    Acrobat 9: Advanced > extend features in Adobe Reader

    Acrobat 10: File > save as > Reader Extended PDF > activate additional features

  • Print everything that is typed in the text field without printing the text fields

    Hello

    I am trying to print a form once filled the text fields I want to print just what I typed in the field, not the text field and the color in the text field. I use CS3.

    Any help would be appreciated!

    Hello Teddy and wellcome to the Group!

    If you want to change the fonts or other things, then you will need to use the PrePrint method. What I usually do is select PrePrint in the 'Show' section in the Script Editor (if you did not go to the toolbar at the top, Windows and select Script Editor). After selecting PrePrint you can now either type the name of the subform and the field you want to change (or you can place the cursor in the script dialog box, hold down the CTRL key and select the field with the mouse) and enter in the JS to change font. It's something like TextField1.fillcolor = "255, 255, 255; (which changes the background in white fill). You can also replace fillcolor fonts or border to change the color of the police or the border. I put a link to an Adobe website that goes over the color JS below changes. You just need to add a method of pre-press for each field that you want to remove the necessary on highlighting. Then once the user hits a button print that you have on the form or use CTRL + P to print the form, it will remove any highlighting.

    Now on the text field does not itself feel that I do not know what you ask for. You ask for the legend does not print or not there is a box around the data entered. If you don't want to have a box surround the text field located in the section purpose of the field (see image below). You just need to select none, if you want to just text. If you want to change that with JS, I put another link below that has the code to change the color of the border in white and the user can't see it. If you do not want to print the legend, the only method is to remove the legend from the text box and replace it with a static text that can be hidden, but I guess that it isn't what you're talking about (correct me if I'm wrong however).

    http://partners.Adobe.com/public/developer/en/LiveCycle/Designer/PDFs/ChangingFieldAndSubf ormBGColors.pdf

    https://forums.Adobe.com/thread/1409617

  • Dynamic text field showing only the number 2.

    I am writing a scrolling shooting game and I have a dynamic text field that keeps the score.  Running inside an ENTER_FRAME event listener, it updates all the images.  By tracing the variable "score", I get the good numbers appearing in the output tab, but on the screen, I see only the number 2. It doesn't matter what position in the number, it is (ie: 20, or 10372 or 521), this digit will be displayed.  If there is no number 2 in the partition, the field shows that the word "" Score: "."

    The variable is declared as such:

    var score: int = 0;

    "The text field is called scorecard and is set to"Classic text"and a dynamic text ' and it's 638 pixels wide (almost the entire width of the scene).

    Here's the code to update the scorecard:

    scoreCard.text = "Note:" + score.

    trace (score);

    The track was simply put in to see if the score was being counted until properly, what is.

    I also tried to eliminate "Score:" and simply used:

    scoreCard.text = score.toString ();

    and got the same results.

    Any ideas of what could be the cause?  From everything I've read, this method should work.

    Eric Gray

    Incorporate (police) all the numbers, and then try again.

  • Text field element submits the page when you press ENTER

    My page has
    -a 'text field' point
    -a 'Send' button (and a related branch, which works correctly).

    Management is working properly, when I hear some data for field text Item.
    and I press the submit button.

    I would like to the text field do the same action,
    When I press ENTER,
    After completing a few data for the text field.

    Currently, this does not work, and I get the following message:

    "ERR-1777: Page 121 provided no page at junction."
    Report this error to the administrator of your application.
    Restart the Application.

    I also tried the "(always present when the page Enter Presseds) text field" setting
    for the parameter "display as" Item.

    You can try my page at:
    http://Apex.Oracle.com/pls/OTN/f?p=9218:121

    Thank you very much
    Marios

    PS

    Make sure that the unconditional branch has a sequence number greater than all other branches - Apex will use the first part, that it can find which corresponds to the current situation. I tend to use 999 for the sequence numbers of the unconditional branches.

    Andy

  • How to convert a text file and give the table

    Hai

    How to convert a text file and give the data of the table

    ISN'T THERE!

    You must put this

    SET_BLOCK_PROPERTY ('TEST_MS', insert_allowed, property_false);
    SET_BLOCK_PROPERTY ('TEST_MS', update_allowed, property_false);

    just before the last exception...

    Published by: Dora on January 19, 2010 14:54

  • How to make the PDF text field to be strikes do not copy/paste from previous text fields?

    Dear friends

    Helps to solve a problem related to the fields of PDF text, please

    Is there a way to make a PDF of the respondent, which ends of fields text to type own text not copy/paste of the previous text fields?

    Thank you very much!

    Copy the following code, used as key event custom field of your field, will prevent to enter more than one character at a time, which means that copy it text from an external source is not possible:

    if (event.change.length>1) event.rc=false;
    

    However, you can inform your users of this restriction, or they think that something is wrong with the file.

  • Input string must be no space in the text field - validation of the need.

    Hello

    I need validation on the text field, like I should be able to single string entered in the text field. for examples - if I entered 'new test', it must raise the error. I should be able to enter only 'test '. (single channel)

    Can someone help me to give better suggestion.

    Kind regards
    Harish Sharma

    1002384 wrote:

    Thanks for the reply, but I'm still confused, I put this "not regexp_like (: Px_ITEM, ' [[: space :]]')]])" in PL/SQL Expression validation in the Expression of Validation 1, but I have to put in exp2.

    You seem to be an existing posting of editing rather than creating a new. 2 validation expression is not used with PL/SQL Expression validations: all the necessary code is contained in 1 Expression of Validation. Review validation options Type: those who use the Validation Expression 1 and 2 Expression of validation explicitly state what values will each. Other types of validation use only 1 Expression of Validation or not.

  • How to pull information from a text field in my email subject line using a button to send email?

    I know how to create a button to e-mail with the static object, but I need to pull on the name field in the subject line.

    I use LiveCycle Designer ES2 v. 9.0 on a Windows computer.

    Example: Change request for < text field of the form >

    Not in the XML file, in the Click event of the button.

    You will find the scripteditor on the 'window '. "scripteditor.

    There you can change the event right next to 'show '.

  • White space from regions... fix them...?

    Hello

    I created a few regions on a page... I hide/show couple of them based on the selection of a group of radio...

    My problem is that, for some strange reason, that I'm extra white space for some of the choices (and not for all of them)...

    I saved a sample on APEX. ORACLE.COM steps for review and comment

    Workspace: tparvaiz
    Username: [email protected]
    Password: tparvaiz

    Application: 28899 default Date and white space
    Application Page no.: 24
    ID/PW: TEST/TEST

    Thank you

    You use dynamic measures to hide the elements rather than with the regions that contain. This leaves the elements of the visible region as extra space. Also the choice of the model of the area of can not be appropriate and include items that generate an extra space (model region Untitled button doen't seems good for the area of Proj_Order, because there are no other buttons). Use a browser with a web Inspector Tool (Safari, Chrome, or Firefox+Firebug) to find the elements generating unwanted space.

    Either:

  • Change the DAs to hide the regions as a whole rather than the individual elements (use static region ID to provide selectors of DA).

  • Keep the DAs that operate at the level of the element, but uses fewer parts, for example to move the items in one region.

    As Re: reversal of the Image, you may be using too many distinct regions. Is not wrong (in so many ways it's a good thing), but there should be good reasons to do so, and must enjoy that there are separate areas by working with regions as a whole. Also consider using subregions to group related areas.

    A naming convention clearer for dynamic Actions would also be a good idea: the current criteria give no idea of what they are doing.

  • Keep the white space from an xsl transformation

    Hi, I really need help on this... I want to be able to use an xml file to put in content and style it in the xsl fragment I can get the xsl transformation to work OK. But! I can't find a way to preserve white space or line breaks. All I get is a continuous paragraph for every words of about 2000 article for each. It looks like hell.

    I tried this element < Preserve-space elements = "ARTICLE" / > is not used in a xsl transformation fragment no chance! and < Preserve-space elements = "*" / >

    Do I need another encoding? I use <? xml version = "1.0" encoding = "UTF-8"? >

    Is there a way I can use html in the xml file? as < br / >

    I know, in Flash, you can specify a return like this \r in the xml file

    Please any help would be appreciated.

    IsleA-Row2_Seat7

    No, I forgot something. A section using CDATA is the right way to store HTML tags in an XML node, but only when using XSLT to output, you must add the disable-output-escaping attribute in the element:

    
    
  • Can you create a text field entered by the user that the content of the flow in a subform?

    I'm working on a project to convert into a document library of more than 600 forms from Word to PDF, most of the time it's simple and binding the fields to the database schema and use subforms works very well - however, there are some cases where there is a combination of input fields by the user mixed with fields of database and in some cases , the fields in the end user are all there, but the amount of content can vary from 250 characters to thousands.  The project manager wants a PDF that allows users to enter any amount of text they should and have the function of shaping the way it is as if all the fields have been populated by the database - I don't know of a way to make that work only if the content is first registered in the schema (or implement CM and have all users working in LiveCycle, but the basic data use PDF, take her is not an option right now).

    If anyone has any ideas how to operate the these things I would be very happy to hear about.

    Thank you very much

    R

    Hello

    If you can post your form in the post, I can have a look and give my comments.

    I created a sample file for your reference...

    (1) Flowed is set to the content property for Page1.

    (2) each text box is placed inside a subform that is also a property content value Flowed.

    (3) in the properties of the form, as the default tab, set the format of PDF rendering dynamic XML form.

    (4) in the properties of the form, on the overview tab, specify the Type of Preview as "Interactive form" and preview XML Adobe as a 'dynamic XML form' form. (this step is to preview the PDF file in the Designer).

    (5) to save the form as dynamic XML form. (File-> Menu save under).

    I hope this helps.

    If you have any questions, please post your form...

    Thank you

    Srini

    Please find the example file the slot location

    https://Acrobat.com/#d=qQohvZGsJrky-sTdPTJbzA

  • I have created a form in Indesign. Is there a way to create the default text in a text field that displays the interactive pdf "insert text here" in the text field?

    I have created a form for the company, so that I work. It is a form that will be used in several offices and has buttons, drop downs and text fields. One of the text fields has a requirement that when the PDF file is opened, the text field has something written in there already, as an example (and one only) INSERT the TEXT HERE. I created the text field in Indesign and used the text tool to type in the area of the body-copy required. After that I have to export it as an interactive PDF, text in the text field disappeared.

    Drop-down lists give an option for a default choice, but I don't see a way to create default text in the Panel of buttons and forms for text fields. Is there a workaround or a hidden feature?

    Thank you!

    Set it in Acrobat.

  • Muse of the synchronized text fields disabled during the download of 3rd party hosting

    The customer site is done in the office and in a version of the phone. The text field for the menu of the day, which he is editing with the 'inbrowserediting.com' function is implemented as a synchronized text. Great, but it does not work! I assumed that it is has something to do with PHP, then I changed hosting and now all these features (also the supplier confirmed it).

    But once again: it does not work.

    After downloading by ftp to a third host, I get the message, that muse disabled the inbrowser function because it seems the host does not support redirection of Web sites.

    -> and then... the text synchronized the ist field cannot be changed.

    I contacted the supplier and that he thinks that all actions are enabled and it should work

    The question now is:

    Which confirms exactly MUSE during the download? are there other technical bases that must be met? I can't find something. No description about this article.

    Y at - it ideas? Thanks in advance!

    I found the solution in this discussion (which I have not found before... Sorry ;-).

    Re: Why I can't use in browser with synchronized text editing?

    Thanks anyway!

  • Format custom text field only when the field is filled

    I have created a form that I need to have the format of a text field "model:"& value of text field, then when it is empty so it is just empty.»

    I put event.value = "template:" + event.value; "." in the format custom properties of the text field it set to format correctly, but if it had not entered in this field he said always model: so what should I do for it to be only occur when there is something entered in the field.

    Change to:

    If (event.value) event.value = "template:"+ event.value; ".

Maybe you are looking for