> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/automate-zh/cao-zuo-zhi-nan/file-and-folder/create-empty-excel.md).

# 创建空Excel

创建空的 Excel 是指在您计算机上指定路径下初始化一个全新的（`.xlsx` 格式）空 Excel 文件的操作。

此操作通常放在脚本的开头，以便在数据爬取（Data Crawler）或日志记录开始推送信息之前准备一个干净的存储文件。

#### 配置参数：

* 文件路径：您希望创建文件的绝对路径，包括文件名和 `.xlsx` 后缀（例如：`D:\GPM\data_crawler.xlsx`）。

#### 实际示例：在爬取文章之前初始化数据导出文件

假设您正在编写一个自动浏览社群并收集（爬取）文章链接、互动次数的脚本，以便进行市场研究。在数据爬取循环开始运行之前，您需要一个空的 Excel 文件来保存结果。

* 配置方式：在脚本的第一步，您调用创建空的 Excel 操作。
  * 文件路径：填写路径 `D:\GPM\ketqua_facebook.xlsx`。
* 结果：
  * 如果在 `D:\GPM\` 目录下没有 `ketqua_facebook.xlsx` 文件，系统将立即创建一个空的 Excel 文件。
  * 如果文件之前已存在，系统将删除旧文件并重新创建一个全新的空文件，以确保之前运行的数据不会与此次运行混淆。

经过此步骤后，您可以放心使用诸如写入 Excel 文件或追加 Excel 文件等操作，将刚刚爬取的数据写入文件。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gpmautomate.com/automate-zh/cao-zuo-zhi-nan/file-and-folder/create-empty-excel.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
