I am working on a program that will eventually automate the creation of text files and put them in a folder. There is a specific length of the rows, 85 (followed by a 4 line counter), and length of each field.
So far most of it has been pretty easy. We have an address (and up to 4 of them) that can be up to, lets say, 70 characters. The issue is that the address starts on line space 65. Since the field can be from 0-70 characters (not a required field) I need a way to parse out anything over the 20th character and if it is less then 70, add trailing 0s. I have been calling fields from other tabs and have something like:
="ASC1 5 "&LEFT(MN_name&REPT(" ",35),35)&LEFT(MN_addr1&REPT(" ",20),20)&"0017"
That part works perfectly. So I have been using a lot of the LEFT(field&REPT(" "#),#). I have tried using &RIGHT(MN_add1&REPT(" ",50),50), but it seems to be just all spaces.
I need my results to be like:
Line 1 ends with "2 WORK SONG RD, " (1 space at end)
Line 2 starts with "NEW DISTRICT " (37 spaces)
What I see is:
Line 1 ends with "2 WORK SONG RD, " (1 space at end)
Line 2 starts with " " (50 spaces)
Any help would be amazing.
So far most of it has been pretty easy. We have an address (and up to 4 of them) that can be up to, lets say, 70 characters. The issue is that the address starts on line space 65. Since the field can be from 0-70 characters (not a required field) I need a way to parse out anything over the 20th character and if it is less then 70, add trailing 0s. I have been calling fields from other tabs and have something like:
="ASC1 5 "&LEFT(MN_name&REPT(" ",35),35)&LEFT(MN_addr1&REPT(" ",20),20)&"0017"
That part works perfectly. So I have been using a lot of the LEFT(field&REPT(" "#),#). I have tried using &RIGHT(MN_add1&REPT(" ",50),50), but it seems to be just all spaces.
I need my results to be like:
Line 1 ends with "2 WORK SONG RD, " (1 space at end)
Line 2 starts with "NEW DISTRICT " (37 spaces)
What I see is:
Line 1 ends with "2 WORK SONG RD, " (1 space at end)
Line 2 starts with " " (50 spaces)
Any help would be amazing.