Skip to content
Matt Nadareski edited this page Sep 19, 2025 · 13 revisions

Update and Manipulate DATs

Flags: -ud, --update

This is the multitool part of the program, allowing for almost every manipulation to a DAT, or set of DATs. This is also a combination of many different programs that performed DAT manipulation that work better together.

Options

Flags Short Description Long Description
-ot=, --output-type= Output DATs to a specified format Add outputting the created DAT to known format. Multiple instances of this flag are allowed. See DatFile Formats for more details about supported values.
-pre=, --prefix= Set prefix for all lines Requires -ot=, --output-type=. Set a generic prefix to be prepended to all outputted lines. See Prefix and Postfix Replacement for more details about supported values.
-post=, --postfix= Set postfix for all lines Requires -ot=, --output-type=. Set a generic postfix to be appended to all outputted lines. See Prefix and Postfix Replacement for more details about supported values.
-q, --quotes Double-quote each item Requires --output-type=miss. This flag surrounds the item by double-quotes, not including the prefix or postfix.
-r, --roms Output roms to miss instead of sets Requires --output-type=miss. By default, the outputted file will include the name of the game so this flag allows for the name of the rom to be output instead.
-gp, --game-prefix Add game name as a prefix Requires --output-type=miss. This flag allows for the name of the game to be used as a prefix to each file.
-ae=, --add-extension= Add an extension to each item Requires -ot=, --output-type=. Add a postfix extension to each full item name.
-rep=, --replace-extension= Replace all extensions with specified Requires -ot=, --output-type=. When an extension exists, replace it with the provided instead.
-rme, --remove-extensions Remove all extensions from all items Requires -ot=, --output-type=. For each item, remove the extension.
-ro, --romba Treat like a Romba depot (requires SHA-1) Requires -ot=, --output-type=. This flag allows reading and writing of DATs and output files to and from a Romba-style depot. This also implies TorrentGZ input and output for physical files. Where appropriate, Romba depot files will be created as well.
--depr, --romba-depth Set depth of depot for outputs Requires -ro, --romba. Optionally, set the depth of output depots. Defaults to 4 deep otherwise.
-dpc, --deprecated Output game instead of machine Requires --output-type=xml. By default, Logiqx XML DATs output with the more modern machine tag for each set. This flag allows users to output the older game tag instead, for compatibility reasons.
-f=, --filename= Set the external name of the DAT Set the external filename for the output DAT(s).
-n=, --name= Set the internal name of the DAT Set the name header field for the output DAT(s).
-de=, --description= Set the description of the DAT Set the description header field for the output DAT(s).
-c=, --category= Set the category of the DAT Set the category header field for the output DAT(s).
-r=, --root= Set a new rootdir Set the rootdir (as used by SuperDAT mode) for the output DAT(s).
-v=, --version= Set the version of the DAT Set the version header field for the output DAT(s).
-au=, --author= Set the author of the DAT Set the author header field for the output DAT(s).
-em=, --email= Set a new email of the DAT Set the email header field for the output DAT(s).
-hp=, --homepage= Set a new homepage of the DAT Set the homepage header field for the output DAT(s).
-u=, --url= Set a new URL of the DAT Set the URL header field for the output DAT(s).
-co=, --comment= Set a new comment of the DAT Set the comment header field for the output DAT(s).
-h=, --header= Set a header skipper to use, blank means all Set the header special field for the output DAT(s). In file rebuilding, this flag allows for either all copier headers (using "") or specific copier headers by name (such as "fds.xml") to determine if a file matches or not. See Copier Headers for more information.
-sd, --superdat Enable SuperDAT creation Set the type flag to "SuperDAT" for the output DAT as well as preserving the directory structure of the inputted folder, if applicable.
-fm=, --forcemerging= Set force merging Set the forcemerging tag to the given value. See Merging Modes for more details about supported values.
-fn=, --forcenodump= Set force nodump Set the forcenodump tag to the given value. See Nodump Modes for more details about supported values.
-fp=, --forcepacking= Set force packing Set the forcepacking tag to the given value. See Packing Modes for more details about supported values.
-ef=, --exclude-field= Exclude a game/rom field from outputs Exclude any valid item or machine field from outputs. See Fields for more information.
-1g1r, --one-game-per-region Try to ensure one game per region This allows users to input a list of regions to use to filter on in order so only one game from each set of parent and clones will be included. This requires either cloneof or romof tags to function properly.
-reg, --region Add a region for 1G1R Requires -1g1r, --one-game-per-region. Add a region (in order) for use with 1G1R filtering. If this is not supplied, then by default, only parent sets will be included in the output. Multiple instances of this flag are allowed.
-orpg, --one-rom-per-game Try to ensure each rom has its own game In some cases, it is beneficial to have every rom put into its own output set as a subfolder of the original parent. This flag enables outputting each rom to its own game for this purpose.
-keg, --keep-empty-games Keep originally empty sets from the input(s) Normally, any sets that are considered empty will not be included in the output, this flag allows these empty sets to be added to the output.
-sds, --scene-date-strip Remove date from scene-named sets If this flag is enabled, sets with "scene" names will have the date removed from the beginning. For example 01.01.01-Game_Name-GROUP would become Game_Name-Group.
-clean, --clean Clean game names according to WoD standards Game names will be sanitized to remove what the original WoD standards deemed as unneeded information, such as parenthesized or bracketed strings.
-ru, --remove-unicode Remove unicode characters from names By default, the character set from the original file(s) will be used for item naming. This flag removes all Unicode characters from the item names, machine names, and machine descriptions.
-dan, --description-as-name Use description instead of machine name By default, all DATs are converted exactly as they are input. Enabling this flag allows for the machine names in the DAT to be replaced by the machine description instead. In most cases, this will result in no change in the output DAT, but a notable example would be a software list DAT where the machine names are generally DOS-friendly while the description is more complete.
-dm, --dat-merged Force creating merged sets Preprocess the DAT to have parent sets contain all items from the children based on the cloneof tag. This is incompatible with the other --dat-X flags. See Merging Modes for more details.
-dfm, --dat-full-merged Force creating fully merged sets Preprocess the DAT to have parent sets contain all items from the children based on the cloneof tag while also performing deduplication within a parent. This is incompatible with the other --dat-X flags. See Merging Modes for more details.
-ds, --dat-split Force creating split sets Preprocess the DAT to remove redundant files between parents and children based on the romof and cloneof tags. This is incompatible with the other --dat-X flags. See Merging Modes for more details.
-dnd, --dat-device-non-merged Create device non-merged sets Preprocess the DAT to have child sets contain all items from the device references. This is incompatible with the other --dat-X flags. See Merging Modes for more details.
-dnm, --dat-non-merged Force creating non-merged sets Preprocess the DAT to have child sets contain all items from the parent set based on the romof and cloneof tags. This is incompatible with the other --dat-X flags. See Merging Modes for more details.
-df, --dat-full-non-merged Create fully non-merged sets Preprocess the DAT to have child sets contain all items from the parent sets based on the cloneof and romof tags as well as device references. This is incompatible with the other --dat-X flags. See Merging Modes for more details.
-trim, --trim Trim file names to fit NTFS length In the cases where files will have too long a name, this allows for trimming the name of the files to the NTFS maximum length at most.
-rd=, --root-dir= Set the root directory for calc Requires -trim, --trim. In the case that the files will not be stored from the root directory, a new root can be set for path length calculations.
-si, --single-set All game names replaced by ! This is useful for keeping all roms in a DAT in the same archive or folder.
-dd, --dedup Enable deduping in the created DAT For all outputted DATs, allow for hash deduping. This makes sure that there are effectively no duplicates in the output files. Cannot be used with --game-dedup.
-gdd, --game-dedup Enable deduping within games in the created DAT For all outputted DATs, allow for hash deduping but only within the games, and not across the entire DAT. This makes sure that there are effectively no duplicates within each of the output sets. Cannot be used with --dedup.
-m, --merge Merge the input DATs By default, all DATs are processed individually with the user-specified flags. With this flag enabled, all of the input DATs are merged into a single output. This is best used with the --dedup or --game-dedup flag.
-di, --diff-all Create diffdats from inputs (all standard outputs) By default, all DATs are processed individually with the user-specified flags. With this flag enabled, input DATs are diffed against each other to find duplicates, no duplicates, and only in individuals.
-did, --diff-duplicates Create diffdat containing just duplicates All files that have duplicates outside of the original DAT are included.
-dii, --diff-individuals Create diffdats for individual DATs All files that have no duplicates outside of the original DATs are put into DATs that are named after the source DAT.
-din, --diff-no-duplicates Create diffdat containing no duplicates All files that have no duplicates outside of the original DATs are included.
-b, --no-automatic-date Don't include date in file name Requires -m, --merge, -di, --diff-all, -did, --diff-duplicates, -dii, --diff-individuals, or -din, --diff-no-duplicates. Normally, the DAT will be created with the date in the file name in brackets. This flag removes that instead of the default.
-dag, --diff-against Diff all inputs against a set of base DATs This flag will enable a special type of diffing in which a set of base DATs are used as a comparison point for each of the input DATs. This allows users to get a slightly different output to cascaded diffing, which may be more useful in some cases. This is heavily influenced by the diffing model used by Romba.
-bg, --by-game Requires -dag, --diff-against. Diff against by game instead of hashes By default, diffing against uses hashes to determine similar files. This flag enables using using each game as a comparision point instead.
-br, --base-replace Replace from base DATs in order By default, no item names are changed except when there is a merge occurring. This flag enables users to define a DAT or set of base DATs to use as "replacements" for all input DATs. Note that the first found instance of an item in the base DAT(s) will be used and all others will be discarded. If no additional flag is given, it will default to updating names.
-rbr, --reverse-base-replace Replace item names from base DATs in reverse By default, no item names are changed except when there is a merge occurring. This flag enables users to define a DAT or set of base DATs to use as "replacements" for all input DATs. Note that the first found instance of an item in the last base DAT(s) will be used and all others will be discarded. If no additional flag is given, it will default to updating names.
-bd=, --base-dat= Add a base DAT for processing Requires -dag, --diff-against, -br, --base-replace, or -rbr, --reverse-base-replace. Add a DAT or folder of DATs to the base set to be used for all operations. Multiple instances of this flag are allowed.
-uf, --update-field Update a game/rom field from base DATs Requires -br, --base-replace or -rbr, --reverse-base-replace. Update any valid item or machine field from base DAT(s). See Fields for more information.
-ons, --only-same Only update description if machine name matches description Requires -uf, --update-field. Normally, updating the description will always overwrite if the machine names are the same. With this flag, descriptions will only be overwritten if they are the same as the machine names.
-dc, --diff-cascade Enable cascaded diffing This flag allows for a special type of diffing in which the first DAT is considered a base, and for each additional input DAT, it only leaves the files that are not in one of the previous DATs. This can allow for the creation of rollback sets or even just reduce the amount of duplicates across multiple sets.
-drc, --diff-reverse-cascade Enable reverse cascaded diffing This flag allows for a special type of diffing in which the last DAT is considered a base, and for each additional input DAT, it only leaves the files that are not in one of the previous DATs. This can allow for the creation of rollback sets or even just reduce the amount of duplicates across multiple sets.
-sf, --skip-first-output Skip output of first DAT Requires -dc, --diff-cascade or -drc, --diff-reverse-cascade. In times where the first DAT does not need to be written out a second time, this will skip writing it. This can often speed up the output process.
-ini=, --extra-ini= Apply a MAME INI for given field Apply any valid MAME INI for any valid field in the DatFile. Multiple instances of this flag are allowed. See Extras for more information.
-fi=, --filter= Filter a game/rom field with the given value(s) Filter any valid item or machine field from inputs. See Filters for more information.
-ofg, --match-of-tags Allow cloneof and romof tags to match game name filters Requires -fi=, --filter=. If filter or exclude by game name is used, this flag will allow those filters to be checked against the romof and cloneof tags as well. This can allow for more advanced set-building, especially in arcade-based sets.
-out=, --output-dir= Set output directory This sets an output folder to be used when the files are created. If a path is not defined, the runtime directory is used instead.
-ip, --inplace Write to the input directories, where possible By default, files are written to the runtime directory (or the output directory, if set). This flag enables users to write out to the directory that the DATs originated from.

Examples

Convert a DAT file to XML and put it in a new folder

--update --output-type=xml --output-dir=OutDir Path\To\DatFile.dat

Convert a folder of DAT files to ClrMamePro and strip parent tags. Note: This would output the created files to the SabreTools folder

--update --output-type=cmp --exclude-of=romof --exclude-of=sampleof --exclude-of=cloneof Path\To\Dats

Remove all files found in a base set of DATs from another set. This example is useful for getting ride of cross-set duplicates without touching similar files in the same set.

--update --diff-against --base-dat="Path\To\Base" InDr

Clone this wiki locally