Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Split string into separate fields

Status
Not open for further replies.

fragglemoo

IS-IT--Management
Nov 20, 2002
41
0
0
GB
Hi

I am using CR2008 and have a string that contains numbers which I need to split into separate fields

e.g

23 26 27 28 48 49
23 27 29
24 63 71 77 86 87 89 90
and so on.

The number of digits in a field can vary but at the moment they are all 2 digits with a space between each one.

Can anyone assist?

Thanks :)
 
You didn't specify if you want these to be classed as string or number values after splitting so I will assume you wish for them to remain as string type.

//{@1}:
stringvar array z := split({table.string}," ");
z[1]

//{@2}:
stringvar array z := split({table.string}," ");
if ubound(x) >= 2 then z[2]

//{@3}:
stringvar array z := split({table.string}," ");
if ubound(x) >= 3 then z[3]

//{@4}:
stringvar array z := split({table.string}," ");
if ubound(x) >= 4 then z[4]

etc.

(*) to LBass as it is based on her previous posts.

'J

CR8.5 / CRXI - Discovering the impossible
 
Thanks for the response - they are staying as strings.

Sorry :( but I'm still a novice at CR, how do I use the above? is it a formula field or lots of formula fields?

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top