File Moving "logic"

Looking for an example (that probably has been described/discussed - apology in advance) that will help me with the following:
I have two folders Account XYZ and Account ABC.
Each folder has Year subfolders of 2022 and 2023.
I would like to develop a rule that moves a file to the proper account and subfolder based upon the content of a PDF, but I'm confused about how to construct this in Hazel.
I have Hazel identifying the Account folder from the file content but not sure how to inspect and extract the Year from the file content and use it for the subfolder directory before moving the file.
Help - pointers greatly appreciated.
-jP
I have two folders Account XYZ and Account ABC.
Each folder has Year subfolders of 2022 and 2023.
I would like to develop a rule that moves a file to the proper account and subfolder based upon the content of a PDF, but I'm confused about how to construct this in Hazel.
I have Hazel identifying the Account folder from the file content but not sure how to inspect and extract the Year from the file content and use it for the subfolder directory before moving the file.
Help - pointers greatly appreciated.
-jP