当前位置: 技术问答>linux和unix
关于字符串的切割及打印格式的问题
来源: 互联网 发布时间:2016-12-10
本文导语: 现在有个文件,内容是 table_schema sum(data_length)/1024/1024 information_schema 0.000000 mysql 0.4555874 需求: echo 出来 table_name:information_schema usestatus :0.000000 table_name:mysql usestatus :0.4555874 这样的格式,求高手帮助 ...
现在有个文件,内容是
table_schema sum(data_length)/1024/1024 information_schema 0.000000 mysql 0.4555874
需求:
echo 出来
table_name:information_schema
usestatus :0.000000
table_name:mysql
usestatus :0.4555874
这样的格式,求高手帮助
table_schema sum(data_length)/1024/1024 information_schema 0.000000 mysql 0.4555874
需求:
echo 出来
table_name:information_schema
usestatus :0.000000
table_name:mysql
usestatus :0.4555874
这样的格式,求高手帮助
|
awk '{printf "table_name:%snusestatus :%sntable_name:%snusestatus :%sn",$3,$4,$5,$6}' yourfile