johnboy691 Posted November 9, 2006 Report Share Posted November 9, 2006 I have a 13 digit number that I copy to a text variable from excel. I then modifiy it to seperate sections as ME won't calculate numbers larger than 10 characters. I have trouble when I modify these back together. For example: on the number 6590600110158 where 659 is a location, 06 is the year, 001 is the Julian date and 10158 is the sequence number. If I crop it between the end of the Julian date and the begining of the sequence number, increment it and then put it back together, everything is ok. BUT, if the end of the Julian date is like 200 or 210 (has ending zero's) and/or the sequence number is 00098 (beginning zeors). It doesn't put my number back together correctly, it leaves out the zeros. How do I get this to merge back together correctly? For example: copied number 6590636509998 comes back with a value of 659063659999 only a 12 digit number and no zero after the 365. Example below of my scripting. variable modify string: Copy part of %T82% to %T83% THE ABOVE LINE COPYS THE LOCATION, YEAR, JULIAN DATE variable modify string: Copy part of %T82% to %T84% THE ABOVE LINE COPYS THE SEQUENCE NUMBER variable modify string: convert %t84% to integer %N4% THE ABOVE LINE CHANGES SEQUENCE NUMBER TO AN INTGER variable modify integer: Inc (%N4%) THE ABOVE LINE INCREMENTS THE SEQUENCE NUMBER varable modify integer: Convert %N4% to text string %T85% THE ABOVE LINE CONVERTS INTEGER BACK TO A STRING variable modify string: Append %T85% to %T83% THE ABOVE LINE APENDS THE INCREMENTED SEQUENCE NUMBER BACK variable modify string: Append %T83% to %T37% THE ABOVE LINE CHANGES THE VARIABLE TO THE ONE USED IN THE RES OF THE SCRIPT. Variable modify string: Trim %T37% Thanks for any help you can give. John Quote Link to comment Share on other sites More sharing options...
paul Posted November 9, 2006 Report Share Posted November 9, 2006 Take a look at the Pad Left command, followed by a Replace of " " with "0". Quote Link to comment Share on other sites More sharing options...
johnboy691 Posted January 2, 2007 Author Report Share Posted January 2, 2007 Paul, thank you very much. After putting this on the bench for a while I finally went back to it and got it to work. Appreciate your help!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.