|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
A high performance database engine using optimized data access for all development environments including Delphi, Visual Studio .NET, Visual Basic, Visual FoxPro. and more. Learn More |
|
#1
|
|||
|
|||
|
carriage returns in text string
I am wishing to extract the contents of a column with datatype varchar2(100) which holds concatenated address data with carriage returns so when used within the application the address elements appear on seperate lines.
I wish to replace the carriage return characters with a comma so the address elements are split into individuals fields as part of the extract How do I a) search for the carriage return character in the string b) replace the carriage return character with a comma. I believe I should be using the chr function but I am not sure how. Can someone provide any answers or guidance please. Thank you in anticipation. |
|
#2
|
|||
|
|||
|
just use the replace function.
|
|
#3
|
|||
|
|||
|
Please try:
select replace('linee eee',chr(13),'c') from dual Cheers, Dan |
|
#4
|
|||
|
|||
|
carriage returns in text string
Thank you
I have been able to resolve the problem with the expert guidance provided. |
|
#5
|
||||
|
||||
|
Objective:
I want to be able to count in real time (using Javascript) to count how many combination words after each carriage return entered in the <textarea> tag occurs. i.e if data in <textarea> tag has this: Quote:
I expect the count to say "2". Setup: I have two input boxes. The first is the <textarea> where the words are entered with identifier of say "name=textareadata" . I also have a 2nd inout box where I want the count to be displayed in real time with identifier say "name=counter" . For the <textarea> tag, I also have this "onKeyup=ShowCount()". The <form> tag has identifier say "name=formdata" . Javascript Code Snippet: Quote:
This does not work. I have actually tried other stuff with regexp etc ... with no luck. The real time update works though as I replaced "count.split(chr(13))" with "count.split(" ")" and is successfully shows the exact count as I enter the data. If I remove the data it decreases the counter. But I want to count combinations words count after each carriage return. Anyone !! Thanks ![]() |
|
#6
|
|||
|
|||
|
I kept trying and finally got it. Here's the code that did the job:
function ShowCount() { var sTextArea = document.formdata.textareadata.value, re = /\r\n/g, aHTMLComments = sTextArea.split(re); document.formdata.counter.value = aHTMLComments.length; } ![]() |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > carriage returns in text string |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|