sed center line
来源:互联网 发布:godaddy专享域名转入 编辑:程序博客网 时间:2024/06/01 10:04
#!/usr/bin/sed -f
# Put 80 spaces in the buffer
1 {
x
s/^$/ /
s/^.*$/&&&&&&&&/
x
}
1为地址,如果是第一行,则在hold space中保存80个空格
# del leading and trailing spaces
y/\t/ /
将TAB换成空格
s/^ *//
s/ *$//
去掉前后的空格
# add a newline and 80 spaces to end of line
G
添加一个\n和80个空格
# keep first 81 chars (80 + a newline)
s/^\(.\{81\}\).*$/\1/
假设文本长度为15
15\n65
# \2 matches half of the spaces, which are moved to the beginning
s/^\(.*\)\n\(.*\)\2/\2\1/
此时15文本\n32空格32空格1空格
替换后为:
32空格15文本1空格
- sed center line
- sed one line
- sed 和read line用法
- Read file line by line (Bash shell script, sed usage)
- Display Actual Cost line Items for Cost Center
- Center
- Useful One Line Programs of "SED" and "AWK"
- sed and awk process xml file in multi line
- USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor)
- Linux Command Line and....ch19(sed编辑器)
- RevitAPI:如何用API实现两条管道按中心线(Center Line)对齐
- line-height功能是垂直居中,center 功能是水平居中
- sed
- Sed
- SED
- sed
- sed
- sed
- xcode
- ORA-00600 internal error code,arguments: 问题
- web service 学习笔记
- tomcat 的 虚拟目录 和 热部署
- maven-compiler-plugin 插件版本信息错误提示的解决方法
- sed center line
- 下拉框spinner:获取选中值的几种方法
- sqlldr的各种用法
- 多线程学习总结
- 大四女生一页简历768个字 成功闯关多家名企
- C中字符串和字符,strlen和sizeof()
- RMAN/EXP ORA-01455: 转换列溢出整数数据类型
- 理解ThreadLocal
- vim 功能命令总结汇总