---
name: Add Suffix to File Names
slug: batch-filename-suffix
category: Automation
description: Batch add a specified suffix to file names using a Python function. Useful for versioning, organizing, or processing files in bulk.
github: "https://github.com/CoderWanFeng/python-office/tree/develop/skills/file/file_name_add_postfix"
language: Python
stars: 1331
forks: 297
install: "git clone https://github.com/CoderWanFeng/python-office"
added: 2026-07-20T06:48:42.537Z
last_synced: 2026-07-28T07:00:49.724Z
canonical_url: "https://dirskills.com/skills/batch-filename-suffix"
---

# Add Suffix to File Names

Batch add a specified suffix to file names using a Python function. Useful for versioning, organizing, or processing files in bulk.

**Install:** `git clone https://github.com/CoderWanFeng/python-office`

## README

# file_name_add_postfix Skill

> 批量重命名：给文件名增加后缀

## 功能描述

给指定文件的文件名增加指定的后缀。

## 所属分类

`office/skills/file/file_name_add_postfix/`

## 调用方式

```python
from office.skills.file import file_name_add_postfix

file_name_add_postfix(
    file_path='./test.txt',
    postfix_content='_backup'
)
```

## 参数说明

| 参数 | 类型 | 必填 | 默认值 | 说明 |
|------|------|------|--------|------|
| `file_path` | str | 是 | - | 文件路径 |
| `postfix_content` | str | 是 | - | 后缀内容 |

## 返回值

`None`

## 使用示例

```python
from office.skills.file import file_name_add_postfix
file_name_add_postfix(file_path='./data.txt', postfix_content='_v1')
```

## 原始函数

`office.api.file.file_name_add_postfix`
