- Oct
- 364
- 17
My employer uses an OLD (DOS) program that outputs CSV. In some cases the output contains quite a bit of spaces within the record, e.g., LEFT MSG FOR {8spaces} ATTY, PHONE 123-456-7890. WILL CALL NEXT WEEK {6spaces} IF NO RESPONSE
Right now, the only way I see to handle that is with a loop that repeatedly replaces multiple internal spaces until there are no multiple-space sections left.
I suggest a function that will replace a number range of repeated characters with a specified number of characters, e.g., %@ReplaceMultiChar [min#-max#, with this many, for this character,LT, string]
LT means "ignore leading" and "ignore trailing"
E.g., Replace occurrences of 5 to 25 spaces with 3 spaces, strip leading spaces but leave any trailing spaces.
Right now, the only way I see to handle that is with a loop that repeatedly replaces multiple internal spaces until there are no multiple-space sections left.
I suggest a function that will replace a number range of repeated characters with a specified number of characters, e.g., %@ReplaceMultiChar [min#-max#, with this many, for this character,LT, string]
LT means "ignore leading" and "ignore trailing"
E.g., Replace occurrences of 5 to 25 spaces with 3 spaces, strip leading spaces but leave any trailing spaces.
Last edited: