Extract data from a string

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

Extract data from a string

Post by chibbert » Thu May 14, 2009 11:13 am

[updated:LAST EDITED ON May-14-09 AT 11:20 AM (EST)]I have a certain bunch of data that is stored in strings where the data spills from one record to another with no spaces. The data example below is actually six independent records but as you can see, the data at the end of record 3 (0000133) is part of the beginning of record 4 (330). Is there any way to break this out and join it up to look like the example #2?____Example #1__99607+C999607+0000110197/1+0000100123/2+0000105825/1+0000133017/__1+0000100297/1+0000100396/1+0000125807/1+0000100412/10+000010040__4/2+0000100917/12+0000103564/2+0000105288/2+0000114967/1+0000133__330/1+0000113084/1+0000111427/1+0000116152/2+0000116178/1+000011__6194/1+0000169987/5+0000169979/8+0000170027/5+0000170035/2+00001__01105/1+0000170118/1+0000170092/5+0000170159/8+0000110908/1 ____Example #2__99607__C999607__0000110197/1 __0000100123/2__0000105825/1__0000133017/1 __0000100297/1__0000100396/1__0000125807/1 __0000100412/10__0000100404/2__0000100917/12 __0000103564/2__0000105288/2__0000114967/1__0000133330/1__0000113084/1__0000111427/1 __0000116152/2__0000116178/1__0000116194/1 __0000169987/5__0000169979/8__0000170027/5 __0000170035/2__0000101105/1__0000170118/1 __0000170092/5__0000170159/8__0000110908/1 ____Thanks for your time.

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

=> RE: Extract data from a string

Post by kfleming » Fri May 15, 2009 9:01 am

As long as the total length of the string is 254 characters or less there is a way to get there by creating a recursive calculated field that contatenates the field value, replacing the + delimiter with a ;, placing the field on the layout with a format as word wrapped and configuring Format Record Layout to begin new line on a semi-colon.____In your example you could use a calculated called recurse and place it on a summary band to give you the list of MYFIELD values____strrep(IIF(recno()=1,trim(MYFIELD),recurse+trim(myfield)),"+",";")____Kathleen__R&R Support

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

==> RE: Extract data from a string

Post by Chris_Hibbert_(Guest) » Tue May 19, 2009 10:05 am

Thanks Kathleen - I didn^t know you could even do such things. I am almost there but I am stuck on "configuring Format Record Layout to begin new line on a semi-colon" I looked and can^t seem to find where I would enforce this. I am using the SQL version but checked both SQL and XBASE designers and couldn^t see it.____Thanks again!____Chris

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

===> RE: Extract data from a string

Post by kfleming » Sun May 24, 2009 9:05 pm

Rats!__That feature is only available in the Xbase version.____Kathleen__R&R Support

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

====> RE: Extract data from a string

Post by Chris_Hibbert_(Guest) » Wed May 27, 2009 8:00 am

Well - I appreciate your attempt :)

Post Reply