| Unix to DOS конвертирование символов переноса строки |
|
|
|
| Статьи - Unix |
# trYou may use tr to remove all carriage returns and Ctrl-z (^Z) characters from a DOS file by entering tr -d '\15\32' < dosfile.txt > unixfile.txt tr cannot be used to convert a document from Unix format to DOS. # awkTo use awk to convert a DOS file to Unix, at the Unix prompt, enter awk '{ sub("\r$", ""); print }' dosfile.txt > unixfile.txt To convert a Unix file to DOS using awk, at the command line, enter awk 'sub("$", "\r")' unixfile.txt > dosfile.txt On some systems, the version of awk may be old and not include the function sub. If so, try the same command, but with gawk or nawk replacing awk. # perl
perl -p -i -e 's/$/\r/ filename Результат сохраняет в тот же самый файл |



