我在txt文件中有长文本
@Column(name = "create_date", nullable = false, updatable = false)
private Instant createDate;
如何将80个字符后的文本拆分为新行?
example:
https://pastebin.com/MnbR0Vdh
it should look like that:
https://pastebin.com/ASKHKrS6
答案 0 :(得分:1)
fold file
或
sed 's/.\{80\}/&\n/g' file
您说您想以80个字符包装文本,但是示例输出显示不同,也许您正在寻找这样的东西?
sed 's/\(^\.\.\. \)\?.\{75\}/&\n... /g' file