I am getting some strange behavior from Excel with a script to open and manipulate delimited text files. Here is the gist …
I have some data files that look like:
the fields are seperated by vertical bars ( ‘|’ ). All of the files are output by the same tool (just different queries).
I open them in Excel with the following Snip
tell application “Microsoft Excel”
open text file filename theFullFile other char “|” with use other
Then I save it out to a workbook. The problem is that sometimes Excel seems to ignore the delimiters and split on whitespace or something else. I get no errors from Excel when the script is run.
I have opened the files that cause problems manually in Excel and it is able to split them on the ‘|’ delimiter.
Has anyone else out there done this kind of thing before? It seems like a pretty basic thing.