我有这个数据集,其中每一行都有两个空格分隔的单词。我希望将每行的两个单词之间的空格转换为制表符。我正在学习 bash 脚本,但我不知道该怎么做。谁能帮忙? 数据集eg-
Confidence NN
in IN
the DT
pound NN
is VBZ
最佳答案
您可以使用 sed
为此:
sed -e "s/[[:space:]]\+/\t/g" <file>
或者喜欢在评论中写下 anubhava :
tr ' ' '\t' < file > out.file
关于linux - 将数据集从空格分隔转换为制表符分隔,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46891441/