开发者

how to replace windows carriage return with a space in a ginormous text file

开发者 https://www.devze.com 2023-02-21 01:16 出处:网络
The file size in question is 60 GB 开发者_JS百科(don\'t ask why). I need to replace the windows carraige return rather quickly. Any one care to share (voodo unix skills welcome)

The file size in question is 60 GB 开发者_JS百科(don't ask why). I need to replace the windows carraige return rather quickly. Any one care to share (voodo unix skills welcome)

Edit: I found this stackoverflow question helpful as well, but I think this could be even large for sed to produce a result in time (let's see I will report back)


Try this on a smaller version of the file first to be sure its ok

sed "s/\r//" infile >outfile


You could simply do

cat file | tr '\n' ' '


You can try the following should work:

cat file | tr -d '\015' > file1
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号