跳至主要内容
小龙虾小龙虾AI
🤖

Text

Transform, format, and process text with patterns for writing, data cleaning, localization, citations, and copywriting.

下载497
星标2
版本1.0.0
general
安全通过
💬Prompt

技能说明


name: Text description: Transform, format, and process text with patterns for writing, data cleaning, localization, citations, and copywriting.

Quick Reference

TaskLoad
Creative writing (voice, dialogue, POV)writing.md
Data processing (CSV, regex, encoding)data.md
Academic/citations (APA, MLA, Chicago)academic.md
Marketing copy (headlines, CTA, email)copy.md
Translation/localizationlocalization.md

Universal Text Rules

Encoding

  • Always verify encoding first: file -bi document.txt
  • Normalize line endings: tr -d '\r'
  • Remove BOM if present: sed -i '1s/^\xEF\xBB\xBF//'

Whitespace

  • Collapse multiple spaces: sed 's/[[:space:]]\+/ /g'
  • Trim leading/trailing: sed 's/^[[:space:]]*//;s/[[:space:]]*$//'

Common Traps

  • Smart quotes (" ") break parsers → normalize to "
  • Em/en dashes ( ) break ASCII → normalize to -
  • Zero-width chars invisible but break comparisons → strip them
  • String length ≠ byte length in UTF-8 ("café" = 4 chars, 5 bytes)

Format Detection

# Detect encoding
file -I document.txt

# Detect line endings
cat -A document.txt | head -1
# ^M at end = Windows (CRLF)
# No ^M = Unix (LF)

# Detect delimiter (CSV/TSV)
head -1 file | tr -cd ',;\t|' | wc -c

Quick Transformations

TaskCommand
Lowercasetr '[:upper:]' '[:lower:]'
Remove punctuationtr -d '[:punct:]'
Count wordswc -w
Count unique linessort -u | wc -l
Find duplicatessort | uniq -d
Extract emailsgrep -oE '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}'
Extract URLs`grep -oE 'https?://[^[:space:]<>"{}

Before Processing Checklist

  • Encoding verified (UTF-8?)
  • Line endings normalized
  • Delimiter identified (for structured text)
  • Target format/style defined
  • Edge cases considered (empty, Unicode, special chars)

如何使用「Text」?

  1. 打开小龙虾AI(Web 或 iOS App)
  2. 点击上方「立即使用」按钮,或在对话框中输入任务描述
  3. 小龙虾AI 会自动匹配并调用「Text」技能完成任务
  4. 结果即时呈现,支持继续对话优化

相关技能