Thanks Tim, but I need the #'s to be added to the end not the beginning.

Michael

PS Interesting that you refer to them as pound signs; they left me and appear in your reply as hash signs. :-)


Tim Rude wrote:
Try this instead:

substring[cat.t["#####";P1F19];0;5]

It appends five pound signs to the beginning of P1F19 then grabs the last
five characters in the resulting string. Substring gets the last five rather
than the first five because of using 0 as the starting position number.
Notice also that cat.t is used rather than cat.c to keep trailing blanks in
P1F19 from causing problems.

Tim Rude

----- Original Message ----- From: "Michael Iannantuoni" <[email protected]>
To: "DataPerfect Users Discussion Group" <[email protected]>
Sent: Tuesday, August 25, 2009 11:43 AM
Subject: [Dataperf] Substring odity


I have an odd situation with the Substring function which I have solved
by using an if statement to avoid the oddity:

In a field formula I have:
P1F19  substring["#####";1;5-length[P1F19]] which is designed to add #'s
to the end of P1F19 if it is shorter than five characters in length.

This works if P1F19 is shorter than five characters but if it is five
characters in length so that 5-length[P1F19] is zero, a # is still added
to the end.

Michael

_______________________________________________
Dataperf mailing list
[email protected]
http://lists.dataperfect.nl/mailman/listinfo/dataperf


_______________________________________________
Dataperf mailing list
[email protected]
http://lists.dataperfect.nl/mailman/listinfo/dataperf

_______________________________________________
Dataperf mailing list
[email protected]
http://lists.dataperfect.nl/mailman/listinfo/dataperf

Reply via email to