perl -lane更改定界符
我有一个班轮:
az account list -o table |perl -lane 'print $F[0] if /GS/i'
我想将默认分界符从“ \ t”更改为“ - ”
如何做到这一点?
只是想强调,我要寻找的是淘汰;)
I have one liner:
az account list -o table |perl -lane 'print $F[0] if /GS/i'
I want to change default delimiter from '\t' to '-'
Any hint how to do this?
Just wanted to stress that it is oneliner I look for ;)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
普通
-a
在任何空格上分配,而不仅仅是选项卡。-f
选项允许您指定其他定界符。Plain
-a
splits on any whitespace, not just tab. The-F
option allows you to specify a different delimiter.perlrun 是告诉您Perl命令行选项的手动页面。它说:
。和:
perlrun is the manual page that tells you about Perl's command-line options. It says:
And: