wak 多行语句 sed多个字符替换
来源:互联网 发布:销量数据分析ppt模板 编辑:程序博客网 时间:2024/06/03 19:33
#awk执行多个if语句
cat /test/filename.log|awk ' {{if(/id/){su(/>[^<]*</,">BJ0<")}} \
{if(/name/){su(/>[^<]*</,">BJ1<")}} \
{if(/sex/){su(/>[^<]*</,">BJ2<")}} \
{if(/age/){su(/>[^<]*</,">BJ3<")}} \
{if(/address/){su(/>[^<]*</,">BJ4<")}} \
print}' >>/test/filename2.log #重定向到文本文件当中
#sed多个替换
cat /test/filename2.log|sed -e "s/ggg/999/g; \
s/qwe/999/g; \
s/iif/999/g; \
s/mnm/999/g; \
s/www/999/g" >>/test/filename3.log
cat /test/filename.log|awk ' {{if(/id/){su(/>[^<]*</,">BJ0<")}} \
{if(/name/){su(/>[^<]*</,">BJ1<")}} \
{if(/sex/){su(/>[^<]*</,">BJ2<")}} \
{if(/age/){su(/>[^<]*</,">BJ3<")}} \
{if(/address/){su(/>[^<]*</,">BJ4<")}} \
print}' >>/test/filename2.log #重定向到文本文件当中
#sed多个替换
cat /test/filename2.log|sed -e "s/ggg/999/g; \
s/qwe/999/g; \
s/iif/999/g; \
s/mnm/999/g; \
s/www/999/g" >>/test/filename3.log
- wak 多行语句 sed多个字符替换
- sed在多个文件夹中替换某个字符
- sed 替换多个空格为一个
- sed awk 替换 多个 文件 字符串
- sed 批量替换多个文件
- sed awk 替换 多个 文件 字符串
- 批量替换多个字符
- 批量替换多个字符
- QString替换多个字符
- 使用sed替换一个字符为N个字符
- 字符替换(包含多个字符的替换)
- Shell Sed 替换特定行特定字符
- sed学习---字符替换
- sed替换特定字符
- sed替换字符
- sed 字符替换
- sed批量替换字符
- linux sed 批量替换文本多个文件中的字符串
- QR码百科
- ORACLE PROCESS
- 给定一个字符串的集合, 要求合并完成后的集合之间无交集。
- C/C++函数名修饰约定
- VC的函数修饰名
- wak 多行语句 sed多个字符替换
- 回溯法
- POJ 3983 快算24 表达式模拟非常好的一个题
- 面向对象的程序设计概论
- IOS5基础教程之一-----如何创建XCode项目
- Silverlight/Windows8/WPF/WP7/HTML5周学习导读(9月10日-9月16日)
- 内存
- TextWatcher基本用法
- Oracle学习笔记(1)