linux - 使用 sed、awk、grep 转换文本

标签 linux bash sed awk grep

我无法解决问题。我有一个包含电子邮件地址的文本。我需要这个文件来更改井号的地址。

例如:

bla bla bla 示例{at 符号}gmail.com -> #######{at 符号}#####.###

最佳答案

您可以像这样使用 sed:

sed -r 's/(^| )[^ @]+@[^ ]+/\1#########@#####.###/g' file
Each message has exactly one header, which is structured into fields. #########@#####.### Each field has a name and a value. #########@#####.### RFC 5322 specifies the precise syntax #########@#####.### .

关于linux - 使用 sed、awk、grep 转换文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19821811/

相关文章:

linux - Bash 中的自定义路径补全

linux - Kotlin Selenium Chromedriver 不存在

Linux Small 纯文本版本

bash - bash中的空字符串是什么

java - 运行 java exec 命令,总是需要应用程序的完整绝对路径?

bash - 在 sed 命令中使用多行变量

linux - 加入由空行分隔的组

linux - Sed:从行中提取正则表达式模式

linux - 如何通过 1 步将本地分支删除传播到远程 - git, github

linux - Raspberry-pi docker 错误 : standard_init_linux. go:178: exec 用户进程导致 "exec format error"