2021-03-26 07:09:51 +00:00
---
2021-03-26 08:47:41 +00:00
toc_priority: 43
2021-03-26 07:09:51 +00:00
toc_title: Files
---
# Functions for Working with Files {#functions-for-working-with-files}
2021-03-26 08:22:43 +00:00
## file(path) {#file}
2021-03-26 07:09:51 +00:00
2021-03-26 08:22:43 +00:00
Reads file as a String. The file can contain subqueries, condition, names of columns and any other information that will be read as one line.
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-26 08:47:41 +00:00
- `path` — The relative path to the file from `user_files_path` . Path to file support following globs in read-only mode: `*` , `?` , `{abc,def}` and `{N..M}` where `N` , `M` — numbers, `'abc', 'def'` — strings.
2021-03-26 07:09:51 +00:00
**Example**
2021-03-26 08:22:43 +00:00
Inserting data from files a.txt and b.txt into a table as different rows.
2021-03-26 07:09:51 +00:00
Query:
``` sql
INSERT INTO table SELECT file('a.txt'), file('b.txt')
```
**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 )
- [file ](../table-functions/file/ )
2021-03-26 07:09:51 +00:00