String concatenation in group by?

Hi,

I'm wondering if its possible to perform concatenation of strings in
"group by".  I'm still using Oracle 9.2, so I cannot take advantage
10g's new "collect" aggregrate function.

Here is an example table, tab_example:

ID    Name
---    -----------
1     Hello
1     World

My desired query result:
ID    Concatenated_Name
---    ------------------------------
1     Hello World


Thanks a lot.

0
5/1/2007 2:16:23 PM
comp.databases.oracle.server 21856 articles. 0 followers. Post Follow

11 Replies
286 Views

Similar Articles

[PageSpeed] 52
"Tao" <gordon.t.wu@gmail.com> a �crit dans le message de news: 1178028983.392635.62470@n59g2000hsh.googlegroups.com...
| Hi,
|
| I'm wondering if its possible to perform concatenation of strings in
| "group by".  I'm still using Oracle 9.2, so I cannot take advantage
| 10g's new "collect" aggregrate function.
|
| Here is an example table, tab_example:
|
| ID    Name
| ---    -----------
| 1     Hello
| 1     World
|
| My desired query result:
| ID    Concatenated_Name
| ---    ------------------------------
| 1     Hello World
|
|
| Thanks a lot.
|

I wonder why people always think they are the first one to ask for a question. <g>

I just put "oracle string aggregation" in Google and the first item returned
 (http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php)
gives 5 ways to do it.

Regards
Micel Cadot 


0
Michel
5/1/2007 2:57:01 PM
Micel,

I believe I've mentioned that I'm still using Oracle 9.2 so 10g's
"collect" function is of no use to me.
Yes I understand any string manipulation can be done using PL/SQL
functions, thanks.

On May 1, 10:57 am, "Michel Cadot" <micadot{at}altern{dot}org> wrote:
> "Tao" <gordon.t...@gmail.com> a =E9crit dans le message de news: 11780289=
83.392635.62...@n59g2000hsh.googlegroups.com...
> | Hi,
> |
> | I'm wondering if its possible to perform concatenation of strings in
> | "group by".  I'm still using Oracle 9.2, so I cannot take advantage
> | 10g's new "collect" aggregrate function.
> |
> | Here is an example table, tab_example:
> |
> | ID    Name
> | ---    -----------
> | 1     Hello
> | 1     World
> |
> | My desired query result:
> | ID    Concatenated_Name
> | ---    ------------------------------
> | 1     Hello World
> |
> |
> | Thanks a lot.
> |
>
> I wonder why people always think they are the first one to ask for a ques=
tion. <g>
>
> I just put "oracle string aggregation" in Google and the first item retur=
ned
>  (http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php)
> gives 5 ways to do it.
>
> Regards
> Micel Cadot


0
5/1/2007 3:01:58 PM
"Tao" <gordon.t.wu@gmail.com> a �crit dans le message de news: 1178031718.880006.168270@h2g2000hsg.googlegroups.com...
Micel,

I believe I've mentioned that I'm still using Oracle 9.2 so 10g's
"collect" function is of no use to me.
Yes I understand any string manipulation can be done using PL/SQL
functions, thanks.

---------------------------------

"collect" is just the last explained way, there 4 others available in 9.2
and one does not use PL/SQL.

Regards
Michel Cadot


0
Michel
5/1/2007 3:10:26 PM
Sorry mother.
So out of 5 ways, the 4th one might apply in my case.  What makes you
think I have no right to ask for ppl's opinion if there is a easier
way that I didn't see?  That offended you so much didn't it.

On May 1, 11:10 am, "Michel Cadot" <micadot{at}altern{dot}org> wrote:
> "Tao" <gordon.t...@gmail.com> a =E9crit dans le message de news: 11780317=
18.880006.168...@h2g2000hsg.googlegroups.com...
> Micel,
>
> I believe I've mentioned that I'm still using Oracle 9.2 so 10g's
> "collect" function is of no use to me.
> Yes I understand any string manipulation can be done using PL/SQL
> functions, thanks.
>
> ---------------------------------
>
> "collect" is just the last explained way, there 4 others available in 9.2
> and one does not use PL/SQL.
>
> Regards
> Michel Cadot


0
5/1/2007 3:28:32 PM
Comments embedded.
On May 1, 10:01 am, Tao <gordon.t...@gmail.com> wrote:
> Micel,
>
> I believe I've mentioned that I'm still using Oracle 9.2 so 10g's
> "collect" function is of no use to me.

So be intelligent enough to not consider that 'option' and proceed on
to the other four.

> Yes I understand any string manipulation can be done using PL/SQL
> functions, thanks.
>

And, yet, there is a non-PL/SQL option available you apparently choose
to overlook.  Instead of disparaging suggestions made to you why not
accept them graciously and evaluate them on their merits?

> On May 1, 10:57 am, "Michel Cadot" <micadot{at}altern{dot}org> wrote:
>
>
>
> > "Tao" <gordon.t...@gmail.com> a =E9crit dans le message de news: 117802=
8983.392635.62...@n59g2000hsh.googlegroups.com...
> > | Hi,
> > |
> > | I'm wondering if its possible to perform concatenation of strings in
> > | "group by".  I'm still using Oracle 9.2, so I cannot take advantage
> > | 10g's new "collect" aggregrate function.
> > |
> > | Here is an example table, tab_example:
> > |
> > | ID    Name
> > | ---    -----------
> > | 1     Hello
> > | 1     World
> > |
> > | My desired query result:
> > | ID    Concatenated_Name
> > | ---    ------------------------------
> > | 1     Hello World
> > |
> > |
> > | Thanks a lot.
> > |
>
> > I wonder why people always think they are the first one to ask for a qu=
estion. <g>
>
> > I just put "oracle string aggregation" in Google and the first item ret=
urned
> >  (http://www.oracle-base.com/articles/10g/StringAggregationTechniques.p=
hp)
> > gives 5 ways to do it.
>
> > Regards
> > Micel Cadot- Hide quoted text -
>
> - Show quoted text -


David Fitzjarrell

0
fitzjarrell (2006)
5/1/2007 3:57:40 PM
On May 1, 10:28 am, Tao <gordon.t...@gmail.com> wrote:
> Sorry mother.
> So out of 5 ways, the 4th one might apply in my case.  What makes you
> think I have no right to ask for ppl's opinion if there is a easier
> way that I didn't see?  That offended you so much didn't it.
>
> On May 1, 11:10 am, "Michel Cadot" <micadot{at}altern{dot}org> wrote:
>
>
>
> > "Tao" <gordon.t...@gmail.com> a =E9crit dans le message de news: 117803=
1718.880006.168...@h2g2000hsg.googlegroups.com...
> > Micel,
>
> > I believe I've mentioned that I'm still using Oracle 9.2 so 10g's
> > "collect" function is of no use to me.
> > Yes I understand any string manipulation can be done using PL/SQL
> > functions, thanks.
>
> > ---------------------------------
>
> > "collect" is just the last explained way, there 4 others available in 9=
..2
> > and one does not use PL/SQL.
>
> > Regards
> > Michel Cadot- Hide quoted text -
>
> - Show quoted text -

What makes you think Michel, or anyone here, thinks that?  Are your
sensibilities so fragile that any comment, no matter the nature, is an
attack on you?  The response you received from Michel provided the
requested  information, and did so with a bit of humour.  It is a
shame  you can't recognize good natured wordplay when it is  presented
to you.


David Fitzjarrell

0
fitzjarrell (2006)
5/1/2007 4:01:02 PM
On May 1, 3:16 pm, Tao <gordon.t...@gmail.com> wrote:
> Hi,
>
> I'm wondering if its possible to perform concatenation of strings in
> "group by".  I'm still using Oracle 9.2, so I cannot take advantage
> 10g's new "collect" aggregrate function.
>
> Here is an example table, tab_example:
>
> ID    Name
> ---    -----------
> 1     Hello
> 1     World
>
> My desired query result:
> ID    Concatenated_Name
> ---    ------------------------------
> 1     Hello World
>
> Thanks a lot.

http://www.williamrobertson.net/documents/one_row.html

0
williamr2019 (119)
5/2/2007 9:02:02 AM
On May 1, 12:01 pm, "fitzjarr...@cox.net" <fitzjarr...@cox.net> wrote:
> On May 1, 10:28 am, Tao <gordon.t...@gmail.com> wrote:
>
>
>
> > Sorry mother.
> > So out of 5 ways, the 4th one might apply in my case.  What makes you
> > think I have no right to ask for ppl's opinion if there is a easier
> > way that I didn't see?  That offended you so much didn't it.
>
> > On May 1, 11:10 am, "Michel Cadot" <micadot{at}altern{dot}org> wrote:
>
> > > "Tao" <gordon.t...@gmail.com> a =E9crit dans le message de news: 1178=
031718.880006.168...@h2g2000hsg.googlegroups.com...
> > > Micel,
>
> > > I believe I've mentioned that I'm still using Oracle 9.2 so 10g's
> > > "collect" function is of no use to me.
> > > Yes I understand any string manipulation can be done using PL/SQL
> > > functions, thanks.
>
> > > ---------------------------------
>
> > > "collect" is just the last explained way, there 4 others available in=
 9.2
> > > and one does not use PL/SQL.
>
> > > Regards
> > > Michel Cadot- Hide quoted text -
>
> > - Show quoted text -
>
> What makes you think Michel, or anyone here, thinks that?  Are your
> sensibilities so fragile that any comment, no matter the nature, is an
> attack on you?  The response you received from Michel provided the
> requested  information, and did so with a bit of humour.  It is a
> shame  you can't recognize good natured wordplay when it is  presented
> to you.
>
> David Fitzjarrell

Because the word he was using "is" harsh?
Maybe Tao over-looked an solution.  But what these forums are for?
That that gives Michel and you the right to bash him?

0
5/3/2007 4:33:11 PM
On May 1, 10:57 am, "Michel Cadot" <micadot{at}altern{dot}org> wrote:
> "Tao" <gordon.t...@gmail.com> a =E9crit dans le message de news: 11780289=
83.392635.62...@n59g2000hsh.googlegroups.com...
> | Hi,
> |
> | I'm wondering if its possible to perform concatenation of strings in
> | "group by".  I'm still using Oracle 9.2, so I cannot take advantage
> | 10g's new "collect"aggregratefunction.
> |
> | Here is an example table, tab_example:
> |
> | ID    Name
> | ---    -----------
> | 1     Hello
> | 1     World
> |
> | My desired query result:
> | ID    Concatenated_Name
> | ---    ------------------------------
> | 1     Hello World
> |
> |
> | Thanks a lot.
> |
>
> I wonder why people always think they are the first one to ask for a ques=
tion. <g>
>
> I just put "oracle string aggregation" in Google and the first item retur=
ned
>  (http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php)
> gives 5 ways to do it.
>
> Regards
> Micel Cadot

Well when you already know the solution, its easy to find it.  For
people who do not already know, its not so easy for them to put the
right key words in google.  Apparently he did search for solutions
before coming here, which is exactly what this group is for.  No
reason to insult people while providing an answer.

0
5/3/2007 4:37:16 PM
<gordon_t_wu@hotmail.com> a �crit dans le message de news: 1178210236.450528.155040@p77g2000hsh.googlegroups.com...
On May 1, 10:57 am, "Michel Cadot" <micadot{at}altern{dot}org> wrote:
> "Tao" <gordon.t...@gmail.com> a �crit dans le message de news: 1178028983.392635.62...@n59g2000hsh.googlegroups.com...
> | Hi,
> |
> | I'm wondering if its possible to perform concatenation of strings in
> | "group by".  I'm still using Oracle 9.2, so I cannot take advantage
> | 10g's new "collect"aggregratefunction.
> |
> | Here is an example table, tab_example:
> |
> | ID    Name
> | ---    -----------
> | 1     Hello
> | 1     World
> |
> | My desired query result:
> | ID    Concatenated_Name
> | ---    ------------------------------
> | 1     Hello World
> |
> |
> | Thanks a lot.
> |
>
> I wonder why people always think they are the first one to ask for a question. <g>
>
> I just put "oracle string aggregation" in Google and the first item returned
>  (http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php)
> gives 5 ways to do it.
>
> Regards
> Micel Cadot

Well when you already know the solution, its easy to find it.  For
people who do not already know, its not so easy for them to put the
right key words in google.  Apparently he did search for solutions
before coming here, which is exactly what this group is for.  No
reason to insult people while providing an answer.

---------------------------------------------------------

I don't see any clue he searched hard as he only got a way.
I only used the words he used:
Oracle is this not Oracle he is working with
"string aggregation", well the subject is "string concatenation in group by"
so "group by" means aggregation, of what... of strings.
So it is clearly obvious to use "oracle string aggregation", or at least
to try it.

Btw, your and his email are the same ones, don't you are the same person?
Is it in your way to talk about you at the third person?

Regards
Michel Cadot


0
Michel
5/3/2007 5:05:08 PM
<gordon_t_wu@hotmail.com> a �crit dans le message de news: 1178209991.303094.297830@y5g2000hsa.googlegroups.com...
On May 1, 12:01 pm, "fitzjarr...@cox.net" <fitzjarr...@cox.net> wrote:
> On May 1, 10:28 am, Tao <gordon.t...@gmail.com> wrote:
>
>
>
> > Sorry mother.
> > So out of 5 ways, the 4th one might apply in my case.  What makes you
> > think I have no right to ask for ppl's opinion if there is a easier
> > way that I didn't see?  That offended you so much didn't it.
>
> > On May 1, 11:10 am, "Michel Cadot" <micadot{at}altern{dot}org> wrote:
>
> > > "Tao" <gordon.t...@gmail.com> a �crit dans le message de news: 1178031718.880006.168...@h2g2000hsg.googlegroups.com...
> > > Micel,
>
> > > I believe I've mentioned that I'm still using Oracle 9.2 so 10g's
> > > "collect" function is of no use to me.
> > > Yes I understand any string manipulation can be done using PL/SQL
> > > functions, thanks.
>
> > > ---------------------------------
>
> > > "collect" is just the last explained way, there 4 others available in 9.2
> > > and one does not use PL/SQL.
>
> > > Regards
> > > Michel Cadot- Hide quoted text -
>
> > - Show quoted text -
>
> What makes you think Michel, or anyone here, thinks that?  Are your
> sensibilities so fragile that any comment, no matter the nature, is an
> attack on you?  The response you received from Michel provided the
> requested  information, and did so with a bit of humour.  It is a
> shame  you can't recognize good natured wordplay when it is  presented
> to you.
>
> David Fitzjarrell

Because the word he was using "is" harsh?
Maybe Tao over-looked an solution.  But what these forums are for?
That that gives Michel and you the right to bash him?

--------------------------------

How does it come that your's and Tao's email are the same ones?

Regards
Michel Cadot



0
Michel
5/3/2007 5:06:48 PM
Reply:
Similar Artilces:

XSLT XML-HTML Transformation using grouping
Is there anyway to generate this type of resulting HTML table from this XML using XSLT? Basically I need to be able to consult 2 trees of data to generate the HTML, but I have not been able to figure out how to do so. There is supposed to be a way of using templates and the key function to do grouping, but can it be done with 2 different trees? If so, are there any examples of such things Thanks for any help, Kevin *** HTML Table chef 1 chef 2 chef 3 must: make.pizza pour.milk maybe: make.orange.juice make.ice.cream ...

Strings iteration
I have some names like aaxxbbyy where xx is '01'..'10' and yy is also '01'..'10'. I think there is a simple, rubyst way of iterating through them, and I ask for your help in finding it. Thank you in advance! On 08.05.2010 12:12, Viorel wrote: > I have some names like aaxxbbyy where xx is '01'..'10' and yy is also > '01'..'10'. I think there is a simple, rubyst way of iterating through > them, and I ask for your help in finding it. Thank you in advance! I am not sure I understand exactly what you are trying to do...

what is LV c code representation of NULL string
I know that through .so/.dll code the representation of any string is a structure of the length followed by the characters, I allocate a long blank string in the LV code and copy over my strings in the so/.dll and that works fine. How do I return a LV NULL string? dgholstein wrote: > I know that through .so/.dll code the representation of any string is > a structure of the length followed by the characters, I allocate a > long blank string in the LV code and copy over my strings in the > so/.dll and that works fine. How do I return a LV NULL string? As long as LabVIEW is not s...

Finding the position of a specific string in a cell array of strings
I have been trying to figure this out today and it is really bugging me: I have a cell array of strings, let's call is A, like this: A = 'abc' '123' 'def' '456' I want to give a query and find out which cell, if any, has the query string. For example, if I want to find out which cell 'def' is in, I want it to tell me that it is in the third cell. If I use regexp to do this, it gives me an answer like this: regexp(A, 'def') [] [] [1] [] Which is not very helpful to me, because I just want a number back--I don'...

from string to list
Hello all, I'm trying to switch from a string to a list of the corresponding ASCII codes with a prog called 'EXPL' : "ABC" -EXPL-> { 65 66 67 } and the reverse process with 'IMPL' : { 65 66 67 } -IMPL-> "ABC" The IMPL prog is straightforward : << CHR SUMLIST >> But for the reverse program I couldn't find a short way to do it with NUM. Is there a way to do it without using a FOR loop ? Thanks for reading. On Apr 12, 9:14=A0am, val <vlep...@aoll.com> wrote: > Hello all, > > I'm trying to switch from a str...

Separating multiline strings
Hey Folks, &nbsp; I am trying to separate a multiline string into a array to strings where each element is the one line of the original string. I have included the vi. Please let me know what's wrong with it. &nbsp; &nbsp; &nbsp; &nbsp;Message Edited by ananda on 07-01-2005 05:31 PM CanNotBelieveIt.vi: http://forums.ni.com/attachments/ni/170/129192/2/CanNotBelieveIt.vi Set your delimiter string to '\'-codes Display (right-click ...), then enter "\n". (or set to hex display and enter 0A) You currently have your delimiter set to the two character str...

FAQ 9.4 How do I remove HTML from a string? #5
This message is one of several periodic postings to comp.lang.perl.misc intended to make it easier for perl programmers to find answers to common questions. The core of this message represents an excerpt from the documentation provided with Perl. -------------------------------------------------------------------- 9.4: How do I remove HTML from a string? The most correct way (albeit not the fastest) is to use HTML::Parser from CPAN. Another mostly correct way is to use HTML::FormatText which not only removes HTML but also attempts to do a little simple formatting of the resu...

Re: how to pass this string string to macro call #5
Dan, Thanks for correcting me. However, it still doesn't answer Jeff's question about why his macro won't work. Jeff, I still don't understand what you're expecting, but one obvious problem with your code is unbalanced parentheses. Also, I was able to get it to work without including the %str functions. I used: libname cmsdmart "c:\art"; %macro CalculateMetrics012(x,y,mlist,ylist); proc sql; create table test as &mlist. ; quit; %mend; %let end=6jun2009; %let mlist=(select timeid from cmsdmart.TimeByDay where thedate=intnx('day',"&...

Remove trailing spaces from a string.
Hi, I need to remove trailing spaces from my data. But trim() dosent seem to work. For example, the query results in the below o/p : select '^'||trim(ref_part_nbr)||'^' from nrconfig_item_masters ^113A Vert - MHT - PWL/R - FPMB - 6.50 - Base Plates ^ ^113A Vert - MHT - PWL/R - FPMB - 6.50 - Rails and Blocks ^ ^113A Vert - MHT - PWL/R - FPMB - 7.00 - Base Plates ^ ^113A Vert - MHT - PWL/R - FPMB - 7.00 - Rails and Blocks ^ ^113A Vert - MHT - PWL/R - FPMB - 7.50 - Base Plates ^ ^113A Vert - MHT - PWL/R - FPMB - 7.50 - Rails and Blocks ^ ^113A Vert - MHT - P...

How to create object of class name of which is in text string?
I know what this is about Abstract Factory pattern. But in example at rubygarden we passing a class to factory and it creates an object from it. But how can i pass a text string to factory which will create an object from it? In later example: i wish to pass string "Foo" or "Bar" not Foo or Bar. ------ From rubygarden library of patterns ------ class Foo; end class Bar; end # Here is the use of the Abstract Factory pattern def create_something( factory ) new_object = factory.new puts "created a new #{new_object.class} with a factory" end # Here we sele...

[PostgreSQL] Unescaping escaped strings?
Hello! How do one unescape strings prepared with pg_escape_string() ? stripslashes() will not work because both these functions are not completely compatible. Thank you all in advance -- Micha� Gancarski "When I get down on my knees, it is not to pray" Madonna Michał Gancarski wrote: > How do one unescape strings prepared with pg_escape_string() ? > stripslashes() will not work because both these functions are not > completely compatible. StripCSlashes() might do it. Technically, it's the inverse of AddCSlashes(), but I can't see any reason it shouldn&...

JNI : converting a propertie to String/jstring
Hi everybody, i want to retrieve an enumeration of ALL JVM properties but i got a problem converting Properties into jstring/string jclass sys; jmethodID met; jstring ret; jobject obj2; //getting properties enumeration sys = (*env)->FindClass (env, "java/lang/System"); met = (*env)->GetStaticMethodID (env, sys, ,getProperties","()Ljava/util/Properties;"); obj2 = (jstring)(*env)->CallStaticObjectMethod(env, sys, met); return obj2; value returned : h�'�'�'�'External.classPK best regards, Won't this return the Properties...

String copy question
I have the copy part of this down, but i can't figure out how to copy just the int's from the string. public class Main extends Object { public static void main(String []uuu) { String str1 = "", str2, str3 =""; str2 = "1234Now is the time for All "; str2 += "good men to come to the aid of tHEIR country123456789"; int k; //Write the code to copy str2 to str1. //You may not use any String class methods to perform the copy for you. ...

string storage
I know that Bytestings in VW act as if they are collections of objects(each object being an instance of Character). But are they actually stored as strings for space reasons? Thanks, Chris Chris Lopeman wrote: > I know that Bytestings in VW act as if they are collections of > objects(each object being an instance of Character). But are they > actually stored as strings for space reasons? One-byte strings (of various encodings and including symbols) are stored as bytes. Two-byte strings (of various encodings and including symbols) are stored as half-words. T...

Counting occurances of string A in string B, and adding it to string B
Let's say I have a string that goes like this: "A horse is a horse is a horse, on a horseman" and I want to count how many "horse" there is in the string. Well, that's easy, by using: $_ = "A horse is a horse is a horse, on a horseman"; my $nr; $nr++ for /horse/ig; print $nr; __END__ Out: 4 Now, I would like add a number to each word that contains the string horse, and this is where I am lost. Basically, what I want to output is this: "A horse (1) is a horse (2) is a horse (3), on a horseman (4)" Note tha...

FAQ Topic
----------------------------------------------------------------------- FAQ Topic - How do I access a property of an object using a string? ----------------------------------------------------------------------- There are two ways to access properties: dot notation and square bracket notation. What you are looking for is the square bracket notation in which the dot, and the identifier to its right, are replaced with a set of square brackets containing a string. The value of the string matches the identifier. For example:- //dot notation var bodyElement = document.body; //squar...

Find methods which refer to string, symbol, or method
I'm digging around in the image to try and figure this out but haven't find the correct method invocation yet and I'm hoping someone might be able to help shortcut this process. What I'm trying to do is to find all methods (either within the entire system or, preferably, just within a single class) which refer to a given string, symbol, or method. I've found the #references family of methods in SmalltalkSystem but have not had luck figuring out how to get them to give back something resembling what I want. Any/all help appreciated. Thanks, Bob On 12/10/200...

Finding a string in an other string, then..
I have a text $alltext, and want to find a specific string $stringtofind that is in the text. Then, I want the script to read a number that is right after the string. What is the best way to get it ? Thanks ! Joel <joel@hotmail.ru> writes: > I have a text $alltext, and want to find a specific string > $stringtofind that is in the text. > > Then, I want the script to read a number that is right after the > string. This sounds like a job for... Regular Expressions! Please read these documents: perldoc perlrequick perldoc perlretut perldoc perlre > What is the bes...

String to integer
Im nearly imbarresed to ask this question ,but how can I convert a string like "niall Brennan" to its integer equivlent i.e "14 9 1 12 12 ........" If you knwo I would be a very happy person thank you. ( its in this section because im applying it to as RSA encryption which I wrote. Niall niallmulhare wrote: > Im nearly imbarresed to ask this question ,but how can I convert a string > like "niall Brennan" to its integer equivlent i.e "14 9 1 12 12 ........" public String convert(String in) { int l = in.length(); StringBuffer out = new String...

[RCR] subclasses of string as hash keys
Current behaviour in Ruby is irritating. example: class A < String; end hash = {} hash[ A.new('x') ] = nil p hash.keys.first.class => String Strings get copied, when they get inserted as keys, this is intended, I think. But if I choose to insert a subclassed object, I expect to get the same class back, copied or not. So I suggest, to change in rb_hash_aset: - if (TYPE(key) != T_STRING || st_lookup(RHASH(hash)->tbl, key, 0)) { - st_insert(RHASH(hash)->tbl, key, val); - } + if ( RBASIC(key)->klass != rb_cString || st_lookup(RHASH(hash)->tbl, key, 0)) {...

String parsing (2 questions)
My text file contains a list of strings that look similar to this: ID1 ID2 ID3 Full name ID4 ----- --- ------------ ---------------- ----- 6523 222 000000564 Adams Cody J 9999 1113 532 000000642 Barnes II Bob R 9999 786 123 000000441 Carter Sr James 9999 3333 245 000000994 Jones Jr Roy J 9999 5644 370 000000234 Martin Tom R 9999 2331 333 000000111 Van Horn Tim R 9999 etc. etc.... Question 1: I will be running a while(<>) loop that reads each line one at a time. How can I extract just the ID1, ID2, and the "full na...

String operation
Hi I have a string with 3 words in it "BLUE RED GREEN" I want it all to be in lower case except the first letter of each word . i.e "Blue Red Green" I know how to convert it all to lower case but im unsure how to keep each of the first letters as capitals. Thanks "Fraser Dickson" <fraser.dickson@gmail.com> wrote in message <hmr7hf$as1$1@fred.mathworks.com>... > Hi I have a string with 3 words in it > > "BLUE RED GREEN" > > I want it all to be in lower case except the first letter of each word . i.e &g...

counting number of results in a string search
Hi, I have another string handling question for the group, since you have all been so helpful in the past. Thank you. Basically, I want to do something really simple: Search a main string for a substring, then count how many times the substring appears in the mainstring e.g. mainstring = "The man walked through the park, the man was happy" substring = "man" Count = 2 (Because 'man' appears twice) Now, to me this sounds like a very simple thing to do, (It is, right?) but I have been working on it for 3 hours now and...

String or string
I am doing something where I do=20 If "force" || "spells" Puts "blah" When I use it it gives a warning about comparing strings, what's happening a= nd how do I fix it? Scratch.mit.edu. Go there! -gbear605= It doesn't seem to mind if those are pre-assigned ... ruby-1.9.2-p0 > if "force" || "spells" ruby-1.9.2-p0 ?> puts "blah" ruby-1.9.2-p0 ?> end (irb):3: warning: string literal in condition (irb):3: warning: string literal in condition blah => nil ruby-1.9.2-p0 > f = "forc...

Re: String question #4
On Thu, 1 May 2008 08:16:37 -0400, Richard A. DeVenezia <rdevenezia@WILDBLUE.NET> wrote: >Dominic Mitchell wrote: >> input var1 var2 $6.; >> cards; >> 99 9982 >> 998 998 >> ; > >The INPUT statement indicates var1 is numeric and var2 is character. Is >this the real situation ? If so, it was not working because var1 (the >numeric) was being implicitly cast as a character string for the comparison, >and when auto-casting, the format is 8., I believe it's BEST12. Try: data _null_; n = 1/3; c = translate(n,'*',' ...