如何在 bash 中获取制表符 delim 文件中的第二列和第三列?
我想使用 bash 处理制表符分隔的文件。我只需要第二列和第三列到一个新文件。
I want to use bash to process a tab delimited file. I only need the second column and third to a new file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
cut(1)
是专门为此目的而制作的:cut(1)
was made expressly for this purpose:Cut 可能是最好的选择,其次是 awk
Cut is probably the best choice here, second to that is
awk
扩展 carl-norum 的答案,仅使用制表符作为分隔符,而不是全部空格:
不要在 d 和 $ 之间放置空格
expanding on the answer of carl-norum, using only tab as a delimiter, not all blanks:
don't put a space between d and $