Splitting data from txt field

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
Tas_(Guest)
Posts: 2
Joined: Tue Oct 10, 2017 12:44 pm

Splitting data from txt field

Post by Tas_(Guest) » Wed May 16, 2007 5:09 pm

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__

SolarisW_(Guest)
Posts: 3
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Splitting data from txt field

Post by SolarisW_(Guest) » Fri May 18, 2007 1:15 am

try maybe a calculated field with,__STRREP(DATA,CHR(32),CHR(10))__which should convert spaces in "DATA" into carriage returns.

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Splitting data from txt field

Post by kfleming » Fri May 18, 2007 9:48 am

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

Tas_(Guest)
Posts: 2
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: Splitting data from txt field

Post by Tas_(Guest) » Wed May 23, 2007 6:27 am

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.

Post Reply