1

I have Windows 7 and am using Notepad++ (v. 6.7.9) for an extremely important document.

The LF (Line Feed) characters were appearing with increasing regularity, so I went on a quest to see if there was a way to get rid of them. I had the bad luck to come across this page: Replace Carriage Return and Line Feed in Notepad++.

The common solutions for my original problem was to unpress the “Show All Characters” icon – mine was not pressed – and to replace " /n" with “blank” in the Find/Replace box. None of that worked.

So in desperation, I followed the next bit of advice, which was:

Edit -> EOL Conversion -> Windows Format (This will append replace LF with CRLF)

When I did so, the program froze for a bit, and then the formatting for the entire document got WRECKED.

It’s like everything got shifted to the right, although this does not quite explain the situation either, because some lines are beginning the way they should be. Anyway, an example, as far as the left margin:

**EXAMPLE OF APPEARANCE**

I tried un-depressing the “Word Wrap” icon, and looked through “Preferences” to see if there was something there.

I have also tried (after clicking on "Undo" once the disaster struck) to save the file and re-open it... the disastrous changes were stuck. I also tried to copy the document to Wordpad (in hopes of copying back to a new document in Notepad++), but the formatting was retained.

What do I do to get this back to normal?

4
  • Can you enable View->Show Symbol->Show End of Line and link an image in the comments? Feb 25, 2016 at 5:20
  • For the future, put your important documents under version control or create backups. You can configure Notepad++ to autosave a backup for you every hour. Feb 25, 2016 at 5:20
  • Dear Mateen, thank you so much for lending me a hand. The image you asked for is here: i.stack.imgur.com/e6ZAS.jpg ... I have tried to get the Autosave feature to run, but failed to make it work; "version control" is something I am ignorant of. I do have a backup of the document, but it is from ten days ago and I have made so many changes since...
    – Jeff
    Feb 25, 2016 at 9:19
  • I was not able to make the Autosave work in the past, but I have downloaded the plugin and maybe it will behave for me, at least for the future. While researching "version control" I ran into this page (superuser.com/questions/390204/…), and learned right-clicking on the file gives a "restore previous versions" option... so I have salvaged a version from 2 days ago. I still will need to do a lot of editing to get my document back on track, but now it will be less painful. Perhaps I will still get a solution here to reverse my disaster..
    – Jeff
    Feb 25, 2016 at 9:53

1 Answer 1

0

Looks like you have duplicate CRLFs. Try running a Replace (Ctrl+H) with Search mode set to Regular Expressions and replacing

(.*?)((\r\n)*)\r\n

with

\1\2<remove />\4

enter image description here

Run another Replace:

<remove />

with

(empty)

5
  • Thank you so much, Mateen, you are so very kind. I'm bowled over by your amazing knowledge. I did as you suggested, but I got a "0 occurrences" message at the bottom of the Find/Replace box. I think what I am going to do is take the most recent saved version (which I would not have found without your help) and edit that... I have a feeling the document is hopelessly corrupted. It's shocking that a word processor can pull a destructive number as this. Maybe I can ask you: Where is the "Autosave" directory located? In Options > AS should I check (Named Files) "Save autorecover in the same dir"?
    – Jeff
    Feb 25, 2016 at 21:42
  • I updated my answer with images; make sure to copy exactly what is written (\ vs /). I'm not too sure about Autosave (I don't use Notepad++). Feb 25, 2016 at 22:36
  • You don't use Notepad++ and you know all of these ins and outs?? I wish I could take a little piece of you and have you with me on all walks of life... think of how much more problem-free I would be. It was so considerate of you to go through the trouble of preparing those images for me, thank you. Your instructions were clear, however, and there was little room for error on my end... I merely copied and pasted your kindly-provided lines. But I went through the process again, and once again I got the "0 occurrences" message at the bottom of the Replace box. Please allow me to thank you again.
    – Jeff
    Feb 26, 2016 at 4:55
  • @Jeff My apologies; I should have tested the regex a bit better. It should run now. Feb 26, 2016 at 17:17
  • Hello Mateen; it sounded like you were hopeful your suggestion would work now, but I am getting the same result. I want to thank you once again for your helpfulness.
    – Jeff
    Feb 26, 2016 at 23:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .