Quantcast
Channel: Active questions tagged windows-subsystem-for-linux - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2796

How to delete carriage returns from Nano?

$
0
0

I copied something from Windows to Nano in WSL and it included carriage returns (CR characters). Even though I removed all carriage returns with the text editor (Notepad++) these are still added after copying, possibly by Windows itself - The more the window is narrower, the more carriage returns Windows adds.

enter image description here

My question:

How could I remove all carriage returns in a find and replace (CTRL+\) action in Nano?

Update1:

If I paste the script and just saving (CTRL+O) there is no change (I made sure that when saving, dos mode is toggled off).

Update2:

Executing dos2unix on the file didn't help - it still contains these Green boxes and as for now I can remove them only manually (not a solution of course). I know there are carriage returns, because if I copy the file back to Notepad++, I see these are displayed as CR chars, when I do View > Show symbol > Show all characters.


Viewing all articles
Browse latest Browse all 2796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>