Creating .dat files (dir2dat)

I am experimenting with creating data files, from a game folder with dir2dat. JRomManager has a very simple and effective tool.

This takes exactly the exact name of the file and places it the description name.

<game name="Secret of Monkey Island, The (1990)">
	<description>Secret of Monkey Island, The (1990)</description>
	<year>????</year>
	<manufacturer></manufacturer>
</game>

But it has no way to handle definite/indefinite articles*. For example, have it change “Secret of Monkey Island, The (1990)” to “The Secret of Monkey Island (1990)”.

I have read some information on the internet and they all say that you have to suffer a bit and change them by hand. Is there any tool that will change the articles automatically?

(*) “the, a, an”, in Spanish they are called definite/indefinite articles, I think in English too.

This this type of stuff I use scripts.

For example a regular expression to modify the dat file in place, a regex something like /<game name="(. *), The(.* )"/<game name=“The $1$2/”/

Then you would do something similar to the filename in your file system for example loop through every file and rename based on the same regular expression.

If this makes no sense let me know and I will clarify you do not need to use regexes per say and can just use more vanilla code but it is much much more tedious.

I’m looking for something like this, how do I use it?
I’ve been trying “search and replace” with Gedit, without any success.

I am trying to edit .dat to make manual playlists, for some “special” cases.

The original file names must be kept.
is the name of the .zip file, is not changed.
… is the name that appears in the game lists in RetroArch, this if changed.

From this:

<game name="Secret of Monkey Island, The (1990)">
<description>Secret of Monkey Island, The (1990)</description>

To this:

<game name="Secret of Monkey Island, The (1990)">
<description>The Secret of Monkey Island (1990)</description>

What I’m looking for is to edit the .dat file to correct all the names, but there are too many to do it by hand, between The Good Old Days, Redump, Total DOS Collections, and eXoDOS there are thousands.