Convert pipe-delimited files to .xls

前端 未结 2 1049
隐瞒了意图╮
隐瞒了意图╮ 2021-01-27 18:16

I\'m trying to convert pipe-delimited files to xls (Excel) with batch file and vbscript. Unfortunately, my \"output.xls\" file is still showing the pipe delimiter in the table a

2条回答
  •  孤街浪徒
    2021-01-27 18:44

    Pipe doesn't equal Comma, Excel natively knows what to do with a CSV, but not with Pipe.

    All is not lost, record your actions opening the file manually, once open highlight column A and click Data / Text To Columns, choose delimited and in the "other" box put a pipe then click next, choose the column formats (great to format numbers as text if you need to like Postcodes and phone numbers) then click finish.

    Now stop the recorder and look at the code it generated. Port this over to your Excel object in your script.

提交回复
热议问题