Subject:Changes to XML file not persisted to disk when saved Author:John Vliet Date:16 Jun 2006 11:52 AM
I have a 813KB XML file with ~11,000 lines in it. Many lines are blank so I did a regular expression search for \n\s*\n and replace with \n. This completes with a dialog reading "The document has been searched and 7118 replacements were made". Visually scanning the file shows that the blank lines have been removed. Now I save the file then close the file. When I re-open the file the blank lines are back.
Subject:Changes to XML file not persisted to disk when saved Author:Minollo I. Date:16 Jun 2006 12:31 PM
Depending on how newlines are encoded in your document, you may have to replace \r\n\s*\r\n into \r\n; otherwise you may risk to end up with orphan \r's that are translated into newlines the next time the document is opened.
Subject:Changes to XML file not persisted to disk when saved Author:John Vliet Date:16 Jun 2006 12:45 PM
That worked. Thanks. Is there a way to set the regular expression engine to check line by line so ^\s*$ would match multiple lines? When I tried that it would only match one line and a find next wouldn't find the next line.