Page 1 of 1

Moving text for an export

Posted: Tue Apr 26, 2011 8:04 pm
by mhoover
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.

=> RE: Moving text for an export

Posted: Sun May 01, 2011 8:21 pm
by kfleming
Can you simply shorten the previous field?____Kathleen__R&R Support

==> RE: Moving text for an export

Posted: Thu May 05, 2011 7:06 am
by mhoover
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.

===> RE: Moving text for an export

Posted: Fri May 06, 2011 7:13 am
by kfleming
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

===> RE: Moving text for an export

Posted: Sat May 07, 2011 1:16 pm
by Tom_Freitas_(Guest)
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____