> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# TemplateIgnoreSpaces

> 关于 TemplateIgnoreSpaces 格式的文档

| 输入 | 输出 | 别名 |
| - | - | - |
| ✔ | ✗ | |

## 说明

与 \[`Template`] 类似，但会跳过输入流中分隔符与值之间的空白字符。
不过，如果格式字符串本身包含空白字符，则输入流中也必须出现这些字符。
此外，还允许指定空占位符 (`${}` 或 `${:None}`) ，将某些分隔符拆分为多个独立部分，以忽略它们之间的空格。
这类占位符仅用于跳过空白字符。
如果所有行中各列的值顺序都相同，则可以使用此格式读取 `JSON`。

> [!NOTE]
>
> 此格式仅适用于输入。

## 示例用法

以下请求可用于根据 [JSON](https://clickhouse.com/docs/zh/reference/formats/JSON/JSON.md) 格式的输出示例插入数据：

```sql theme={null}
INSERT INTO table_name 
SETTINGS
    format_template_resultset = '/some/path/resultset.format',
    format_template_row = '/some/path/row.format',
    format_template_rows_between_delimiter = ','
FORMAT TemplateIgnoreSpaces
```

```text title="/some/path/resultset.format" theme={null}
{${}"meta"${}:${:JSON},${}"data"${}:${}[${data}]${},${}"totals"${}:${:JSON},${}"extremes"${}:${:JSON},${}"rows"${}:${:JSON},${}"rows_before_limit_at_least"${}:${:JSON}${}}
```

```text title="/some/path/row.format" theme={null}
{${}"SearchPhrase"${}:${}${phrase:JSON}${},${}"c"${}:${}${cnt:JSON}${}}
```

## 格式设置
