batch file + convert LF to CR+LF

后端 未结 2 824
日久生厌
日久生厌 2020-12-18 08:00

We have a shell script file named LineFeed.sh which does a function of converting a Linefeed(LF) to Carriage Return + LineFeed. We want the same to

2条回答
  •  隐瞒了意图╮
    2020-12-18 08:39

    Building on the generally noted way of doing this using the type command, you can also convert all of the files (or whatever wildcard you may prefer) and dump them in a temp folder using the following:

    md temp
    for %a in (*.*) do type "%a" | find /v "" > temp\"%a"
    

    If the general idea was to replace the originals then you can just move the files back out of the temporary location and delete the temp folder

提交回复
热议问题