Page 1 of 1
Splitting data from txt field
Posted: Wed May 16, 2007 5:09 pm
by Tas_(Guest)
I like to be able to split the data coming in from a comments field from my view and display parts of it as labels e.g. __ - field in the database has following value "This is test data"__ - on my report, i want the data to be displayed in the following format:__ This__ is__ test__ data____The data will be different for every record so an ideal way is to go through the line, pick up the position of first space and print upto that many chars in the first label. Then for the second label, start from the first space position and print upto next occurence of space.____OR if anyone can suggest another way to get same result. Many thanks__
=> RE: Splitting data from txt field
Posted: Fri May 18, 2007 1:15 am
by SolarisW_(Guest)
try maybe a calculated field with,__STRREP(DATA,CHR(32),CHR(10))__which should convert spaces in "DATA" into carriage returns.
=> RE: Splitting data from txt field
Posted: Fri May 18, 2007 9:48 am
by kfleming
The WORD function allows you to return a word based on its position in a character string. The default delimiter is a space but you can set it to something different if you want.____So WORD("This is test data",3) for example would return test.____if you want to return the word based on the record number you could use:__WORD(comment,recno())____Kathleen__R&R Support
==> RE: Splitting data from txt field
Posted: Wed May 23, 2007 6:27 am
by Tas_(Guest)
Thank you for your help__I have managed to do it in a slightly different way by using a combination of SUBSTR() and AT() functions.