> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Files 相关文档

# Files

<div id="file">
  ## file
</div>

以字符串形式读取文件，并将数据加载到指定的列中。文件内容不会被解析。

另请参见表函数 [file](/zh/reference/functions/table-functions/file)。

**语法**

```sql theme={null}
file(path[, default])
```

**参数**

* `path` — 相对于 [user\_files\_path](/zh/reference/settings/server-settings/settings#user_files_path) 的文件路径。支持通配符 `*`、`**`、`?`、`{abc,def}` 和 `{N..M}`，其中 `N`、`M` 为数字，`'abc'`、`'def'` 为字符串。
* `default` — 如果文件不存在或无法访问，则返回该值。支持的数据类型：[String](/zh/reference/data-types/string) 和 [NULL](/zh/reference/settings/formats#input_format_null_as_default)。

**示例**

将 a.txt 和 b.txt 文件中的数据以字符串形式插入表中：

```sql theme={null}
INSERT INTO table SELECT file('a.txt'), file('b.txt');
```
