Search code examples
bashnotepad++text-files

Delete CRLF in text file using Bash or Notepad++


I think this is easier than I think, anyway I would like to know your ideas. I have this file:

AVP78031.1

AVP78042.1

ATO98108.1

ATO98120.1

But I need to do this:

AVP78031.1
AVP78042.1
ATO98108.1
ATO98120.1

Is there a way in NotePad++ to do this? However, I think this type of edition could do it in Bash Script or even only with the terminal. Is there a way to do this?

If you think that there is another way easier to do this, please let me know.

Any suggestion is always welcome.

Thank you for your time!


Solution

  • Using Notepad++


    • Ctrl+H
    • Find what: (\R){2,}
    • Replace with: $1
    • CHECK Wrap around
    • CHECK Regular expression
    • Replace all

    Explanation:

    (\R)        # group 1, any kind of linebreak
    {2,}        # may appear 2 or more times    
    

    Replacement:

    $1          # content of group 1, linebreak
    

    Screenshot (before):

    enter image description here

    Screenshot (after):

    enter image description here