Removing Windows newlines on Linux (sed vs. awk)

前端 未结 4 1636
我在风中等你
我在风中等你 2020-12-07 20:57

Have some delimited files with improperly placed newline characters in the middle of fields (not line ends), appearing as ^M in Vim. They originate from freebcp (on Centos 6

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-07 21:36

    sed -e 's/\r//g' input_file

    This works for me. The difference of -e instead of -i command.

    Also I mentioned that see on different platforms behave differently. Mine is:sed --version This is not GNU sed version 4.0

提交回复
热议问题