Page 1 of 1

Carriage Return in XML file

Posted: Tue May 14, 2013 2:51 am
by badelman
Hello, I have a folder called "Movie" and underneath that folder I have category folders like "Action", "Drama", etc.. Inside those folder I have individual movie folders like "Thelma & Louise".

So the directory structure is: Movie\Comedy\Thelma & Louise\*.*

Inside each movie folder is an XML file with a ton of info in it. The main content I want to modify is the "Genre". The reason is most movies have several genre's but not all main genre's are listed 1st or 2nd which is how my media player picks up this text and categorizes it by itself.

So the section in each *.xml file looks exactly like this:
<genre>
<name>Action</name>
</genre>

So far I'm using:
In the Regular Expression tab, with 'dot matches newline' selected.

Regex:
Code: Select all<genre>.*?</genre>
Replace :
Code: Select all<genre><name>Comedy</name></genre>

This almost works but I really need the output to look like the above example:
<genre>
<name>Action</name>
</genre>

How can I setup text crawler to do a CARRIAGE RETURN after <genre> and after </name>? I tried \r and it doesn't work either..

Thanks!

Re: Carriage Return in XML file

Posted: Thu May 23, 2013 3:22 pm
by DigitalVolcano
Late reply!
You can do this by editing the replace expression in the multi-line editor (the pencil button next to the box where you type).
Simply add the new lines into the box as you would like it to look:

<genre>
<name>Comedy</name>
</genre>