如何去除以某些字符结尾的换行符啊?

如何去除以某些字符结尾的换行符啊?

比如有文件source.txt
复制内容到剪贴板
代码:
abc0001
ddddd
jjjj0123
kkkkkk
dddddddddd
jjjjjjjjjjjjjjjjjjjj
把数字结尾的换行去除,变成target.txt
复制内容到剪贴板
代码:
abc0001ddddd
jjjj0123kkkkkk
dddddddddd
jjjjjjjjjjjjjjjjjjjj
谢谢!

      
我也经常被这个文体困扰,可以试一下col -bx 或 dos2unix.      
不知是不是這樣?
复制内容到剪贴板
代码:
fang@bash ~
$ cat junk
abc0001
ddddd
jjjj0123
kkkkkk
dddddddddd
jjjjjjjjjjjjjjjjjjjj

fang@bash ~
$ sed ':a;/^.*[0-9]$/N;s/\n//;ta' junk
abc0001ddddd
jjjj0123kkkkkk
dddddddddd
jjjjjjjjjjjjjjjjjjjj

fang@bash ~
$
      
journalist
看了我好多天了,终于把楼上的回答给看懂了
执行老早就可以了,看懂意义那才是难啊