I am trying to write a MS Word template with macros that properly format a comma-delimited text file that will be exported to a UNIX server. This newly created text file (called default.csv) will then be imported into our database. I have everything working properly except that the file always places a ^M (carriage return) on the last line of the file (visible when I use VI editor on UNIX). This is bad for our database import. My question is this: How can I remove only the last ^M from default.csv using VBA before the file is exported to the UNIX server.
The file looks like the following:
"20030410030859","04/10/03 UPS","0.00","45632","Y"^M
^M
The problem occurs because the last ^M is imported into our database and a substring error results.
Any help would be greatly appreciated. Like I said, I am a VBA Word newbie. Thanks.
The file looks like the following:
"20030410030859","04/10/03 UPS","0.00","45632","Y"^M
^M
The problem occurs because the last ^M is imported into our database and a substring error results.
Any help would be greatly appreciated. Like I said, I am a VBA Word newbie. Thanks.