Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to remove new line character only in some lines of code.

Example xml file:
XML
<document>
<chapter>
<test aid:pstyle="1">
<title>
</title>
</test>
</chapter>
<test2 aid:pstyle="2">
<title2>
</title2>
</test2>
</document>


Expected output:

XML
<document>
<chapter>
<test aid:pstyle="1"><title></title></test>
</chapter>
<test2 aid:pstyle="2"><title2></title2></test2>
</document>


Wherever the attribute "aid:pstyle" is there, I need to remove new line character till the line where that attribute tag ends. How to do it??
Posted

1 solution

Just search for "\r\n<test">" and remove the "\r\n".

Rather simple..
 
Share this answer
 
v3
Comments
Vidhya Raju 17-Jan-15 7:30am    
<test> tag is just an example.. I need to remove new line character in the line from the tag where aid:pstyle attribute presents to the tag ends

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900