相关疑难解决方法(0)

将每个字符放在一个新行上

我有这样一个文件:

This is a sentence.
This is another sentence.
Run Code Online (Sandbox Code Playgroud)

我需要在每个字符后面添加一个新行,这样每行只出现一个字符,例如:

T
h
i
s

i
s

a

s
e
n
t
e
n
c
e
.
T
h
i
s

i
s

a
n
o
t
h
e
r

s
e
n
t
e
n
c
e
.
Run Code Online (Sandbox Code Playgroud)
  • 该文件为UTF-8,包含许多非英文字符.
  • 空格或回车是否有自己的线并不重要.

如何将每个字符删除到新行?

bash

21
推荐指数
4
解决办法
1万
查看次数

标签 统计

bash ×1