如何从行转换为列?

Ann*_*met 11 command-line text-processing

我有一个 .txt 文件,其中的数字是这样排序的(在同一行):

106849_01373    106849_01967    106850_00082    23025.7_01059   
Run Code Online (Sandbox Code Playgroud)

我想像这样转换它们:

106849_01373
106849_01967
106850_00082
23025.7_01059
Run Code Online (Sandbox Code Playgroud)

我不知道要使用哪个命令。有人可以帮我解决这个问题吗?

hee*_*ayl 16

很容易tr

tr -s '[:blank:]' '\n' <file.txt
Run Code Online (Sandbox Code Playgroud)

例子:

% cat file.txt                    
106849_01373    106849_01967    106850_00082    23025.7_01059   
106849_01373    106849_01967    106850_00082    23025.7_01059   
106849_01373    106849_01967    106850_00082    23025.7_01059   
106849_01373    106849_01967    106850_00082    23025.7_01059   

% tr -s '[:blank:]' '\n' <file.txt
106849_01373
106849_01967
106850_00082
23025.7_01059
106849_01373
106849_01967
106850_00082
23025.7_01059
106849_01373
106849_01967
106850_00082
23025.7_01059
106849_01373
106849_01967
106850_00082
23025.7_01059
Run Code Online (Sandbox Code Playgroud)


sou*_* c. 6

这是一个 xargs

xargs -n1 < file.txt
Run Code Online (Sandbox Code Playgroud)

演示:

$ cat file.txt                    
106849_01373    106849_01967    106850_00082    23025.7_01059 

$ xargs -n1 < file.txt
106849_01373
106849_01967
106850_00082
23025.7_01059
Run Code Online (Sandbox Code Playgroud)