Removing all line breaks and adding them after certain text

Notepad++

Notepad++ Problem Overview


I have text file in which I have to remove all line breaks, and later add new ones after each text </row>. how could I do that using replace tool?

Notepad++ Solutions


Solution 1 - Notepad++

You need to that in two steps, at least.

First, click on the ¶ symbol in the toolbar: you can see if you have CRLF line endings or just LF.

Click on the Replace button, and put \r\n or \n, depending on the kind of line ending. In the Search Mode section of the dialog, check Extended radio button (interpret \n and such). Then replace all occurrences with nothing (empty string).

You end with a big line...

Next, in the same Replace dialog, put your delimiter (</Row>) for example and in the Replace With field, put the same with a line ending (</Row>\r\n). Replace All, and you are done.

Solution 2 - Notepad++

You can also go to Notepad++ and do the following steps:

Edit->LineOperations-> Remove Empty Lines or Remove Empty Lines(Containing blank characters)

Solution 3 - Notepad++

You can also try this in Notepad++

  • Highlight the lines you want to join (ctrl + a to select all)
  • Choose Edit -> Line Operations -> Join Lines

Solution 4 - Notepad++

  • Open Notepad++
  • Paste your text
  • Control + H

In the pop up

  • Find what: \r\n
  • Replace with: BLANK_SPACE

You end up with a big line. Then

  • Control + H

In the pop up

  • Find what: (\.)
  • Replace with: \r\n

So you end up with lines that end by dot

And if you have to do the same process lots of times

  • Go to Macro
  • Start recording
  • Do the process above
  • Go to Macro
  • Stop recording
  • Save current recorded macro
  • Choose a short cut
  • Select the text you want to apply the process (Control + A)
  • Do the shortcut

Solution 5 - Notepad++

I have achieved this with following
Edit > Blank Operations > Remove Unnecessary Blank and EOL

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTautvydasView Question on Stackoverflow
Solution 1 - Notepad++PhiLhoView Answer on Stackoverflow
Solution 2 - Notepad++OrchidView Answer on Stackoverflow
Solution 3 - Notepad++Ismail AkarView Answer on Stackoverflow
Solution 4 - Notepad++Daniel Botero CorreaView Answer on Stackoverflow
Solution 5 - Notepad++Denish ThummarView Answer on Stackoverflow