【发布时间】:2021-03-12 11:59:56
【问题描述】:
数据样本输入:
Name mobile url message text
test11 1234567890 www.google.com "Data Test New
Date:27/02/2020
sample1: 1bags
sample2: 20bags
Regards
The test user user user Sangha
Ph:091 : 123456789"
test12 1234567891 www.google.com hello
我的输出应该是
Name mobile url message text
test11 1234567890 www.google.com "Data Test New\nDate:27/02/2020\nsample1: 1bags\nsample2: 20bags\nRegards\nThe test user user user Sangha\nPh:091 : 123456789"
test12 1234567891 www.google.com hello
我使用了下面的命令,但它不起作用
awk '!/"$/{sub(/$/,"\\n");printf "%s",$0;next}1' file
我也使用了其他几个命令,但在我的情况下它们都不起作用
【问题讨论】: