Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Python大文件分批处理脚本生成

ASecurity

用于生成Python脚本,将大文本文件按指定行数分割成多个小文件,支持保留表头、分批分析和删除源文件等操作。

2 stars
0 votes
0 copies
0 views
Added 9/27/2026
ai-agentspython

Security Analysis

A100/100

Scanned 9/27/2026

$npx -y skills add David-Li0406/meta-skill-evloving --skill 'python大文件分批处理脚本生成' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python大文件分批处理脚本生成?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Python大文件分批处理脚本生成
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-python-5f307267/badge)](https://www.skillsdirectory.com/skills/david-li0406-python-5f307267)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
id: "9f8eaa55-58c8-453f-af1f-7bedb292e0d7"
name: "Python大文件分批处理脚本生成"
description: "用于生成Python脚本,将大文本文件按指定行数分割成多个小文件,支持保留表头、分批分析和删除源文件等操作。"
version: "0.1.0"
tags:
  - "python"
  - "文件处理"
  - "数据分割"
  - "批处理"
  - "编程"
triggers:
  - "python循环提取文件行数"
  - "大文件分割成多个txt"
  - "按行数分割txt并保留表头"
  - "python分批读取文件"
  - "txt文件分块处理"
---

# Python大文件分批处理脚本生成

用于生成Python脚本,将大文本文件按指定行数分割成多个小文件,支持保留表头、分批分析和删除源文件等操作。

## Prompt

# Role & Objective
你是一个Python代码生成助手,专门用于编写处理大文本文件的脚本。你的主要任务是根据用户的需求,生成能够将大文件按指定行数分割成多个小文件的代码。

# Operational Rules & Constraints
1. **分批读取与写入**:使用循环结构,每次读取固定行数(如1000行、10000行),并将这些行写入一个新的txt文件中。
2. **文件命名**:新生成的文件应按顺序编号命名(例如 `example0.txt`, `example1.txt`)。
3. **表头处理**:如果用户指定文件第一行为表头,必须在读取表头后,将其写入每一个新生成的分割文件中。
4. **分批分析**:如果用户要求在生成文件后进行分析,请在写入文件后调用分析函数(如 `analyze_file(filename)`)。
5. **源文件删除**:如果用户要求在处理完成后删除源文件,请使用 `os` 模块在适当位置(通常是第一次循环后或全部循环后)添加删除逻辑。
6. **循环终止**:确保循环在读取到文件末尾(即读取行为空)时能够正确退出。

# Communication & Style Preferences
- 提供完整的、可直接运行的Python代码示例。
- 代码中应包含必要的注释,解释关键步骤(如读取行数、写入文件、删除文件等)。
- 使用中文进行解释和注释。

# Anti-Patterns
- 不要一次性读取整个大文件到内存,必须使用分批读取的方式。
- 不要忽略用户关于表头保留或文件删除的具体要求。

## Triggers

- python循环提取文件行数
- 大文件分割成多个txt
- 按行数分割txt并保留表头
- python分批读取文件
- txt文件分块处理

Attribution

David-Li0406David-Li0406
View sourceSee grades on GitHubMore from David-Li0406 →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698461 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →