使用 Applescript 从 Excel 保存干净的 CSV 文件
我有一个过程,需要从 Web 下载 Excel 电子表格,使用 Excel Mac 2008 打开它,将其另存为 csv 文件,然后使用 php 解析它。手动过程运行良好并保存干净的 CSV 文件。我正在尝试使用 Applescript 自动化这部分,并且它有点有效,但是生成的 CSV 文件包含一堆奇怪的字符。
这是我正在处理的 Applescript:
tell application id "com.microsoft.Excel" to open "~/Documents/input.xls"
tell application id "com.microsoft.Excel" to tell active sheet to save in ("output.csv") as "CSV file format"
我尝试了各种 CSV 选项(Mac、Windows、MSDos),它们不会产生显着不同的结果。
I have a process that requires downloading an Excel Spreadsheet from the Web, opening it using Excel Mac 2008, saving it as a csv file, and then parsing it using php. The manual process works fine and saves a clean CSV file. I am trying to automate this part using Applescript, and it sort of works, however, the CSV file generated contains a bunch of weird characters.
Here is the Applescript I am working on:
tell application id "com.microsoft.Excel" to open "~/Documents/input.xls"
tell application id "com.microsoft.Excel" to tell active sheet to save in ("output.csv") as "CSV file format"
I have tried various CSV options (Mac, Windows, MSDos) and they do not produce substantially different results.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个...
Try this...