Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old September 11th, 2003, 02:00 PM
neilp neilp is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 3 neilp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old September 11th, 2003, 04:00 PM
hedge hedge is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2002
Posts: 692 hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 20 h 2 sec
Reputation Power: 19
just use the replace function.

Reply With Quote
  #3  
Old September 22nd, 2003, 04:51 PM
Dan Drillich Dan Drillich is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 68 Dan Drillich User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Please try:

select replace('linee
eee',chr(13),'c') from dual

Cheers,
Dan

Reply With Quote
  #4  
Old September 23rd, 2003, 03:42 PM
neilp neilp is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 3 neilp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
carriage returns in text string

Thank you

I have been able to resolve the problem with the expert guidance provided.

Reply With Quote
  #5  
Old October 9th, 2003, 07:21 AM
keenlearner keenlearner is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 2 keenlearner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs down Javascript: Split on Carriage Returns

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 want to see<Enter>
This is so


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:
function ShowCount()
{
var count = document.formdata.textareadata.value;
count = count.split(chr(13));

document.formdata.counter.value = count.length;
}


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

Reply With Quote
  #6  
Old October 9th, 2003, 08:00 AM
keenlearner keenlearner is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 2 keenlearner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Wink Success !!!

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;

}

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > carriage returns in text string


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway