Adding file extensions and comparing xml files
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Ok, so I have been tasked with solving this problem that appears to have two distinct stages to it. The ask is essentially to compare 2 sets of xml files looking for differences and report the output. It is to compare 2 environments for QA checking.
However, he first issue is that the vast majority of the files, although they ARE xml files, are not labelled as such, i.e. they are extracted without file extensions....is there any way to add these via Alteryx?
Then secondly, to go through file by file and compare the xml structures and report any differences that are found.
I am assuming some form of iterative macro using the directory tool for the second part but im at a bit of a loss for the first piece.
Can anyone help on either front?
- Labels:
- Batch Macro
- Help
- Iterative Macro
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
From your description this sounds quite complicated. For starters you will need to get all of your files in a directory tool and then use that to create fullpaths. You will then use a batch macro to pull in the full paths. Your problem next is how you choose to parse the xml - you can try to use the xml tool and take the file specific schematic info from that - or you can try to use some text parse strategy (bring in the file as a plain text document and go from there). My strategy would really depend upon how complex the underlying xml is.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I think ive sorted the first part, which was no doubt the easier part, however im still stuck at how to compare directories worth of files which all have different structures (essentially they are salesforce objects).
Any suggestions of how to even start?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You mentioned "It is to compare 2 environments for QA checking".
If your task is simply to determine "Do the files match: Yes or No?", then maybe the DOS fc (file compare) command will do enough. This will verify if the files match, but if not, will list the differences.
That is not to say that Alteryx cannot help.. You could use Alteryx to analyze the two lists of files to pair up the ones to be compared, and then generate a text file (named something like CompareSets.BAT) that contains a series of lines such as..
fc path\to\baselinefolder\file1.xml path\to\QA\folder\file1.whateverExtension >file1.differences
fc path\to\baselinefolder\file2.xml path\to\QA\folder\file2.whateverExtension >file2.differences
fc path\to\baselinefolder\file3.xml path\to\QA\folder\file3.whateverExtension >file3.differences
.. then you run the .BAT to check the results
