All Forums Analytics
mitumanish 2 posts Joined 06/08
23 Jun 2008
Counting number of text lines in a character string

Hi, I have got a character string with muliple lines (user presses carriage return). I need to count the number of lines (number of times carraige return) is entered. Does anyone know how to do it.

rgs 106 posts Joined 02/07
25 Jun 2008

You should be able to use a recursive query to do the job. Look at this post:http://www.teradata.com/teradataforum/Topic11452-9-1.aspxIn that example the separator was a ‘,’. You can change that to your line separator character. If you just want the count then just change the last line of the query from:select subpart from temp_table;toselect count(subpart) from temp_table;good luck.

jainayush007 50 posts Joined 03/11
30 Mar 2011

The link provided seems no more active..I would be glad if you can provide us the new link or post the example here..

Thanks,
Ayush

You must sign in to leave a comment.