on 03-31-2015 7:55 PM
Hello-
I have a field that is a 'string' which can have 1 value in it, 4 characters, or it can have numerous values in it, up to 240 characters. The string could look like:
1234
or
123456789012 ....up to 240 characters
It will always be either 4 or in increments of 4. There is nothing separating the data. I would like it to show every 4 characters + a 'space' + the next 4 characters + 'space', etc.
1234
or
1234 5678 9012
Any help?
thanks!
Hi Jennifer,
Try:
stringvar s := {string_field};
numbervar i;
for i := 1 to len(s) STEP 4 do
(
stringvar s1 := s1 + s[i to i+3] + ' ';
);
s1;
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello-
That did not seem to work. It is picking up the first record and keeping it the same and then adding +1 to each record.
So the first record was (its a ship to code):
MADI which read it correctly
the second record is PERS and returning the data as:
MADIMADIMADIMADI
I should also mention I am grouping on this field as well. There is not always multiple codes in one string.
thank you
Hi Jennifer,
use this only
stringvar s := {string_field};
numbervar i;
for i := 1 to len(s) STEP 4 do
(
stringvar s1 := s1 + s[i to i+3] + ' ';
);
s1;
in field format of group field (right click to goup field> Format Field>Display string )
open its formula window and paste above expression.
It will definately work.
i try this scenario in my report field value 20150218155527323699001
outpout printed 2015 0218 1555 2732 3699 001
Regards,
Nilesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.