{"id":1715,"date":"2014-01-16T13:10:53","date_gmt":"2014-01-16T13:10:53","guid":{"rendered":"http:\/\/blog.bachi.net\/?p=1715"},"modified":"2014-01-16T13:42:11","modified_gmt":"2014-01-16T13:42:11","slug":"convert-the-line-endings-from-dos-to-unix-format","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=1715","title":{"rendered":"Convert the line endings from DOS to UNIX format"},"content":{"rendered":"<p>CR = Carriage Return<br \/>\nLF = Line Feed<\/p>\n<table>\n<tr>\n<td><strong>Betriebssystem<\/strong><\/td>\n<td><strong>Zeichensatz<\/strong><\/td>\n<td><strong>Abk\u00fcrzung<\/strong><\/td>\n<td><strong>Code Hex<\/strong><\/td>\n<td><strong>Code Dezimal<\/strong><\/td>\n<td><strong>Escape-Sequenz<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Unix, Linux, Android, Mac OS X, AmigaOS, BSD<\/td>\n<td>ASCII<\/td>\n<td>LF<\/td>\n<td>0A<\/td>\n<td>10<\/td>\n<td>\\n<\/td>\n<\/tr>\n<tr>\n<td>Windows, DOS, OS\/2, CP\/M, TOS (Atari)<\/td>\n<td>ASCII<\/td>\n<td>CR LF<\/td>\n<td>0D 0A<\/td>\n<td>13 10<\/td>\n<td>\\r\\n<\/td>\n<\/tr>\n<tr>\n<td>Mac OS bis Version 9, Apple II, C64<\/td>\n<td>ASCII<\/td>\n<td>CR<\/td>\n<td>0D<\/td>\n<td>13<\/td>\n<td>\\r<\/td>\n<\/tr>\n<tr>\n<td>AIX OS &#038; OS\/390<\/td>\n<td>EBCDIC<\/td>\n<td>NEL<\/td>\n<td>15<\/td>\n<td>21<\/td>\n<td>\\025<\/td>\n<\/tr>\n<\/table>\n<h3>sed<\/h3>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nNAME          sed - stream editor for filtering and transforming text\r\nDESCRIPTION   Sed is a stream editor. A stream editor is used to perform\r\n              basic text transformations on an input stream.\r\n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# DOS =&gt; UNIX\r\n# replace every &quot;\\r&quot; with &quot;&quot;\r\n$ sed &quot;s\/\\r\/\/&quot; infile &gt;outfile\r\n\r\n# UNIX =&gt; DOS\r\n# add in every line-end (RegEx $) before \\n the character \\r\r\n$ sed &quot;s\/$\/\\r\/&quot; infile &gt;outfile\r\n<\/pre>\n<p><a href=\"http:\/\/stackoverflow.com\/questions\/2613800\/how-to-convert-dos-windows-newline-to-unix-newline-in-bash-script\">How to convert DOS\/Windows newline to Unix newline in bash script?<\/a><br \/>\n<a href=\"http:\/\/www.tty1.net\/sed-tutorium\/sed-tutorium.html\">sed Tutorium &#8211; Eine Einf\u00fchrung in sed<\/a><br \/>\n<a href=\"http:\/\/www.catonmat.net\/blog\/wp-content\/uploads\/2008\/09\/sed1line.txt\">Useful one-line scripts for sed<\/a><\/p>\n<h3>tr<\/h3>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nNAME          tr - translate or delete characters\r\nDESCRIPTION   Translate, squeeze, and\/or delete characters\r\n              from standard input, writing to standard output.\r\n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# delete every &quot;\\r&quot;\r\ntr -d \\r &lt;infile &gt;outfile\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>CR = Carriage Return LF = Line Feed Betriebssystem Zeichensatz Abk\u00fcrzung Code Hex Code Dezimal Escape-Sequenz Unix, Linux, Android, Mac OS X, AmigaOS, BSD ASCII LF 0A 10 \\n Windows, DOS, OS\/2, CP\/M, TOS (Atari) ASCII CR LF 0D 0A 13 10 \\r\\n Mac OS bis Version 9, Apple II, C64 ASCII CR 0D 13 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1715","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/1715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1715"}],"version-history":[{"count":15,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/1715\/revisions"}],"predecessor-version":[{"id":1732,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/1715\/revisions\/1732"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}