小编use*_*496的帖子

在数字中添加千位分隔符

在蟒蛇中

 re.sub(r"(?<=.)(?=(?:...)+$)", ",", stroke ) 
Run Code Online (Sandbox Code Playgroud)

用三元组分割一个数字,例如:

 echo 123456789 | python -c 'import sys;import re; print re.sub(r"(?<=.)(?=(?:...)+$)", ",",  sys.stdin.read());'
 123,456,789
Run Code Online (Sandbox Code Playgroud)

如何用 bash/awk 做同样的事情?

bash awk string shell-script

53
推荐指数
5
解决办法
5万
查看次数

标签 统计

awk ×1

bash ×1

shell-script ×1

string ×1