Moving text for an export

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

Moving text for an export

Post by mhoover » Tue Apr 26, 2011 8:04 pm

Hello, I have an export (text data file). The customer that uses this file needs a data item (field) moved over to spaces to the left. I can move it to the right with a calculated field like (""+""+""+field )- not sure how to do this for the left.

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

=> RE: Moving text for an export

Post by kfleming » Sun May 01, 2011 8:21 pm

Can you simply shorten the previous field?____Kathleen__R&R Support

mhoover
Posts: 4
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: Moving text for an export

Post by mhoover » Thu May 05, 2011 7:06 am

That^s how I^m doing other text feilds, the problem with this one is I^m using val()and have to preserve the decimal places (4), so I^m trying to find a way to do this and have it a char field.

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

===> RE: Moving text for an export

Post by kfleming » Fri May 06, 2011 7:13 am

You can use the transform function to convert a number to a string and specify formatting.____So if I have a numeric field called mynumber that contains 123.4567__I can use:__transfrom(mynumber,"99999.9999")__and my output will be a string with 123.4567____Kathleen__R&R Support

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

===> RE: Moving text for an export

Post by Tom_Freitas_(Guest) » Sat May 07, 2011 1:16 pm

If the number field is multiple lengths; 1234.567 and 123.456 then you could do the following;____Pad the front end with as many characters that you may need then add the field to it left trim like; new_field = space(9-len(ltrim(str(<fieldname>,12,2))))+ltrim(str(<fieldname,12,3))____the new_field will always be 9 characters in length.____Tom____

Post Reply