Using content of one file to manipulate another one

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Dear,

I am unsure on how to progress. After having split an XML file, I have

- one XML file, holding all desired information and
- one PDF file - which is, well, the document.

Both files are named the same (obviously apart from the extension).
What I would like to achieve is to have the PDF file

- renamed,
- tagged and
- redated

based on information from the XML file.
Can you please push me into the right direction, as I currently have no idea on how to start.

Thank you for your support,
best regards,

Connor
Connor
 
Posts: 8
Joined: Sun Jun 02, 2019 1:56 pm

Are they in the same folder? If so, you can try something like:
Code: Select all
    If (all) are met
        Extension is pdf
        Name matches (• pdf name)
        If (all) are met
            Extension is xml
            Name matches (• pdf name)
            Contents contain match <<<whatever>>>

Search the help for match patterns and nested conditions. In this example, (• pdf name) is a custom attribute with a pattern of "anything". It will end up grabbing the name of the pdf file. When you then test is against the xml file, you are seeing if it has the same name.

You'll have to figure out the pattern for the contents match but you'll want some sort of custom attribute to match the part that you will use in the rename action.
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Dear,

thank you for pushing me in the right direction. For some reason I seemingly broke it.
What I did was to create a set of rules to

1. identify the fitting files and to
2. rename and tag it based on the XML-content.

These rules are setup like this:

https://www.dropbox.com/s/vpl8pmpaa8jjapk/Screenshot%202019-07-07%2019.47.14.png

I have stored the files on an external (USB3) HDD, both xml and pdf in the same folder

https://www.dropbox.com/s/0pcu3zjapkgbi0i/Screenshot%202019-07-07%2019.48.11.png

But even though the initial condition is the fulfilled obviously, the "Preview" shoes that it doesn't find any related XML files - which cannot be true according to my view on the directory content.
How can I get a deeper view into the log - apart from the usual "started" and "stopped" to understand, why name.pdf and name.xml look the same, bit are not treated accordingly?

Thank you in advance,
best regards,

Connor
Connor
 
Posts: 8
Joined: Sun Jun 02, 2019 1:56 pm

The preview might be misleading here as it may be showing the status of the last file it checked (with none of the ones before it matching either, though they might have matched some of the conditions).

One thing to try is to have a test rule with all of the nested conditions at the top level and preview it against the xml file. Make sure that part is working before nesting it to match against the pdf.
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron