跳到主要内容

替换文本 ExcelMake

替换文本 Excel 是一个批量查找和替换操作,它会在所有工作表中的每个单元格中搜索。 Excel 工作簿,使用字面或正则表达式模式替换匹配的文本,并可选择对替换的内容应用字体格式。 PDF4me 在一个工作表中处理所有工作表 API 调用支持按顺序替换多个短语,使其适用于数据标准化、品牌重塑和无需打开即可自动更新内容。 Excel有关详情 Excel 文本函数和查找替换行为,请参见 微软 Excel 替换函数Open XML SDK 文本处理

本模块的功能

PDF4me Excel替换文本 在单个工作表的所有工作表中搜索并替换文本 Excel 在你的工作簿中 Make 场景。添加一个或多个“短语”数组项:每个项指定一个搜索文本模式、一个替换文本值,以及用于正则表达式、区分大小写和整单元格匹配的可选标志。您还可以对替换后的内容应用字体格式。所有替换操作按顺序在单个进程中运行。 API 调用该函数后,更新后的工作簿即可上传或向下传递。

相关博客文章
目前尚无关于此功能的博客文章——敬请期待。
在此期间,您可以浏览 PDF4me 博客,查看适用于各平台的教程和工作流程。
访问博客

验证您的身份 API 要求

每一个 PDF4me 模块 Make 需要有效 联系创建或选择一个可以容纳您的 PDF4me API 关键在于确保该方案能够安全地验证文本替换请求。

您不容错过的重要事实

所有工作表都会被处理。
“替换文本”模块会自动搜索并替换工作簿中所有工作表的内容。没有参数可以限制处理范围,仅针对特定工作表。所有工作表都会在一次处理过程中完成,从而确保隐藏工作表或辅助工作表中不会残留过时的文本引用。
正则表达式捕获组在 ReplacementText 中工作。
当 IsExpression 为真时,在 ReplacementText 中使用 $1、$2 等来引用 SearchText 正则表达式模式中的捕获组。例如,匹配电话号码各部分的模式可以将它们重新组合成标准格式。短语项按数组顺序处理,因此在串联替换时请仔细规划顺序。
格式设置仅适用于替换后的内容。
每个“短语”项中的可选“格式”对象仅对替换后的文本应用字体更改(颜色、粗体、斜体、大小、下划线),而不是对整个单元格应用更改。您可以将粗体和斜体设置为“应用”、“移除”或“继承”。这样,您就可以在不重新格式化同一单元格中周围文本的情况下,以视觉方式突出显示更新后的内容。
PDF4me Excel“替换文本”模块显示文件名和文档(映射自前一个模块),以及包含搜索文本、替换文本和格式选项的短语数组。

文件名和文档信息来自之前的模块。短语数组接受多个按顺序处理的搜索替换操作。

参数

必需的: 必须提供连接号、文件名、文档以及短语数组中的至少一个元素(包含搜索文本和替换文本)。所有其他短语属性和格式设置均为可选。

范围必需的它的作用例子
ConnectionRequiredPDF4me API connection. Click Add and paste your API key if connecting for the first time.Your PDF4me connection
File NameRequiredExcel filename with extension. Map from the prior module's file name output.data.xlsx
DocumentRequiredBinary Excel buffer from a cloud storage download (Google Drive, Dropbox, SharePoint), email attachment, or HTTP response.1. Data
Phrases: SearchTextRequiredText or regex pattern to search for. Use with IsExpression true for regex. Processed across all worksheets.OldCorp Inc.
Phrases: ReplacementTextRequiredText to substitute for each SearchText match. Set to empty string to delete the matched text without inserting anything.NewCorp LLC
Phrases: IsExpressionConditionalSet true to treat SearchText as a regex pattern. Supports capture groups ($1, $2) in ReplacementText. Default is false (literal match).false
Phrases: CaseSensitiveConditionalSet true for case-sensitive matching. Default is false: "oldcorp" matches "OldCorp". Set true when exact casing matters.false
Phrases: MatchEntireCellConditionalSet true to match only cells where the entire content equals SearchText. False (default) matches partial text within cells.false
Phrases: FormattingConditionalOptional object applying font changes to replaced text only: FontName, FontColor (hex), FontSize, Bold/Italic/Underline (Apply, Remove, or Inherit), StrikethroughType, ScriptType.{"Bold":"Apply","FontColor":"#003366"}

输出

场地类型它包含什么
NameStringOutput Excel filename with extension.
Doc DataBufferThe updated Excel workbook as a binary buffer with all replacements applied across every worksheet. Pipe directly into a cloud storage upload, email attachment, or any downstream module.

如何替换文本 ExcelMake

  1. 添加 PDF4me Excel替换文本 致你 Make 设想。
  2. 选择 联系 (或点击) 添加 用你的 API 钥匙)。
  3. 地图 文件名文档 来自先前的云存储下载或HTTP模块。
  4. 点击 添加项目 在下面 短语。 进入 搜索文本 (要查找的文本)和 替换文本 (要替换的内容,或留空以删除的内容)。
  5. 设置可选标志: IsExpression 对于正则表达式, 区分大小写 用于精确封装, 匹配整个单元格 用于全细胞匹配。
  6. (可选)扩展 格式化 仅对替换后的文本应用字体颜色、粗体或其他样式。
  7. 添加更多短语项以进行更多替换(按顺序处理)。点击 节省 然后跑。地图 文件日期 将输出结果发送到上传或电子邮件模块。

何时应该使用“替换文本”功能 Excel

Excel中何时应该使用“替换文本”功能?Common Make scenario patterns using Replace Text.
每周标准化数据录入错误
  1. 每周五下午 6 点会触发一个预定事件。
  2. Google Drive 下载主数据工作簿。
  3. 将文本替换为多个短语:“California”替换为“CA”,“Widget Type A”替换为“Widget-A”,全部禁用大小写以进行灵活匹配。
  4. 标准化工作簿已上传回 Google Drive 数据团队会收到一封完成邮件。
重新命名公司名称,涵盖所有平台 Excel 文件
  1. A Dropbox 当文件被放入品牌重塑队列时,监视文件夹功能将被触发。
  2. 将文本替换为 SearchText“OldCorp Inc.”,ReplacementText“NewCorp LLC”,CaseSensitive true,Formatting set to apply the new brand color (#003366) and Bold。
  3. 所有工作表均在一次调用中处理完毕,确保隐藏标签页中不会残留任何引用。
  4. 重新命名后的工作簿已保存到输出文件夹,并且重新命名日志已更新。
使用正则表达式规范化电话号码
  1. 计划触发器会从中检索客户数据文件。 SharePoint
  2. 将“替换文本”设置为 IsExpression true,“搜索文本”设置为与常见电话格式匹配的正则表达式,“替换文本”使用捕获组 ($1, $2, $3) 输出“(555) 123-4567”格式。
  3. 第二个“短语”项使用更简单的字面规则来纠正任何剩余的异常值。
  4. 已上传规范化工作簿。 CRM 导入数据后,会将摘要发送给数据团队。

常见问题解答

Does this module support regular expressions for text replacement in Excel?+
Yes. Set IsExpression to true in the Phrases array item and enter a regex pattern in SearchText. Use $1, $2 in ReplacementText to reference capture groups from the pattern. For example, a regex matching three groups of phone digits can reassemble them into (555) 123-4567 format. Phrases items are processed sequentially, so plan the order carefully if one replacement feeds into the next.
Can I replace text in specific worksheets only?+
No. The Replace Text module processes all worksheets in the workbook automatically. Every tab is included in a single pass. If you need worksheet-level control, pre-filter the workbook using another Excel module before passing it to Replace Text.
How do I delete text without replacing it with anything?+
Set ReplacementText to an empty string. The module removes the matched text from the cell and inserts nothing. This works for both literal and regex matches and applies across all worksheets.
Can I apply font formatting only to the text I replaced?+
Yes. Each Phrases array item accepts an optional Formatting object. Set FontColor to a hex value, Bold to Apply, and Italic to Apply or Inherit. The formatting applies only to the newly inserted ReplacementText, not to surrounding text in the same cell. This is useful for visually highlighting corrections or rebranded content.
Are multiple Phrases items processed in order?+
Yes. The module processes Phrases array items sequentially from first to last. If the replacement produced by item 1 matches the SearchText of item 2, item 2 will match that already-replaced content. Design the order with this chaining behavior in mind, especially when multiple patterns could overlap.

相关模块

获取帮助