如何在输入中用新行替换空格,例如:
/path/to/file /path/to/file2 /path/to/file3 /path/to/file4 /path/to/file5
等等...
要获得以下内容:
/path/to/file
/path/to/file2
/path/to/file3
/path/to/file4
/path/to/file5
Run Code Online (Sandbox Code Playgroud)
我发布这个问题是为了帮助其他用户,在我开始输入这个问题之前,在 UNIX SE 上找到有用的答案并不容易。之后我发现了以下内容:
给定一个像这样的文件
First,Last,Age
Cory,Klein,27
John Jacob,Smith,30
Run Code Online (Sandbox Code Playgroud)
是否有命令行实用程序来转置内容,以便输出看起来像这样
First,Cory,John Jacob
Last,Klein,Smith
Age,27,30
Run Code Online (Sandbox Code Playgroud)