2021-03-26 07:09:51 +00:00
---
2022-04-09 13:29:05 +00:00
sidebar_position: 43
sidebar_label: Files
2021-03-26 07:09:51 +00:00
---
2022-06-02 10:55:18 +00:00
# Functions for Working with Files
2021-03-26 07:09:51 +00:00
2022-06-02 10:55:18 +00:00
## file
2021-03-26 07:09:51 +00:00
2021-03-30 17:10:03 +00:00
Reads file as a String. The file content is not parsed, so any information is read as one string and placed into the specified column.
2021-03-26 07:09:51 +00:00
**Syntax**
``` sql
2021-03-26 08:22:43 +00:00
file(path)
2021-03-26 07:09:51 +00:00
```
**Arguments**
2021-03-30 17:10:15 +00:00
- `path` — The relative path to the file from [user_files_path ](../../operations/server-configuration-parameters/settings.md#server_configuration_parameters-user_files_path ). Path to file support following wildcards: `*` , `?` , `{abc,def}` and `{N..M}` where `N` , `M` — numbers, `'abc', 'def'` — strings.
2021-03-26 07:09:51 +00:00
**Example**
2021-03-30 17:11:30 +00:00
Inserting data from files a.txt and b.txt into a table as strings:
2021-03-26 07:09:51 +00:00
Query:
``` sql
2021-03-28 18:26:51 +00:00
INSERT INTO table SELECT file('a.txt'), file('b.txt');
2021-03-26 07:09:51 +00:00
```
**See Also**
2021-03-26 08:22:43 +00:00
- [user_files_path ](../../operations/server-configuration-parameters/settings.md#server_configuration_parameters-user_files_path )
2021-03-26 09:25:33 +00:00
- [file ](../table-functions/file.md )