Hi folks,
I have an input file which has 5 digit chars.
My requirement is to pad a character at the left most position and truncate the right most one. kindly suggest how to achieve this
Ex :
Input
1,ABCDE
Output:
1,SABCD
1,SSABC
1,SSSAB
1,SSSSA
1,SSSSS
Shifting and Truncating
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
a mix of substring operations should get you there, eg
newvalue = left(oldvalue, 2):'S':right(oldvalue,4)
newvalue2 = left(oldvalue, 2):'SS':right(oldvalue,3)
..etc
do that in a stage variable is one way, eg if you wanted each value in a new column.
use a loop if you wanted each one as a new record.
newvalue = left(oldvalue, 2):'S':right(oldvalue,4)
newvalue2 = left(oldvalue, 2):'SS':right(oldvalue,3)
..etc
do that in a stage variable is one way, eg if you wanted each value in a new column.
use a loop if you wanted each one as a new record.