Insert new lines in XML text using Visual Studio.

I 've got XML files as one long string, not formatted. IE explorer shows them nicely with all indentation and ablility to collapse parts.
However to edit or compare files using Windiff or Winmerge it will be convinient to have them with short lines, e.g. each element in a new line.

Fortunately VS has ability to insert new lines in replace operation.
1.Click Ctrl-G
2. Tick "Use Regular Expressions"
3. In Find specify [>]
4. In Replace specify \0\n.
5 Click "Replace All"
After all XML ">" characters a new line will be inserted.

I also used the same approach to insert line breaks into HTML files.

posted @ Monday, January 21, 2008 7:48 PM

Print

Comments on this entry:

No comments posted yet.

Your comment:



 (will not be displayed)


 
 
 
Please add 1 and 5 and type the answer here:
 

Live Comment Preview:

 
«August»
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456