unix连接分隔符char [英] unix join separator char

查看:155
本文介绍了unix连接分隔符char的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很抱歉,这个琐碎的问题.

Sorry for the maybe trivial question.

我用unix join 命令进行了一些尝试,尝试获取制表符而不是空格作为默认的分隔符. -t是参数,但是这些参数不起作用(ubuntu 9.10 64位2.6.31-14,GNU coreutils版本7.4)

I fought a bit with the unix join command, trying to get tabs instead of whitespaces as the default separators. -t is the argument, but these don't work (ubuntu 9.10 64 bit 2.6.31-14, GNU coreutils version 7.4)

join file1 file2 -t"\t"
join file1 file2 -t="\t"
join file1 file2 -t="\\t"
join file1 file2 -t $"\t"

等等当然,我总是可以使用一些精致的解决方案,例如

Et cetera. Of course, I can always use some inelegant solution like

join file1 file2 > output
sed "s/ /\t/g" output

但是我想看起来很聪明:-)而且,如果有-t参数,它必须可以工作.

But I wanted to look smart :-) Moreover, if there's a -t argument, it must work.

推荐答案

我认为它需要即时生成的变量

I think it takes a variable generated on-the-fly

尝试

join file1 file12 -t $'\t'

这篇关于unix连接分隔符char的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆