Contents Contain Match - Odd Behavior

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

Moderator: Mr_Noodle

Contents Contain Match - Odd Behavior Fri Jan 03, 2020 12:47 pm • by ccgthree
Image

Hi Everyone,

I'm having an issue with a "contents contain match" rule that was working previously but is not doing so now. The rule was set to scan the file (an Excel XLSX file) for "Billing Period[...][start date]-[end date]." Oddly enough, I cannot get Hazel to match contents at all on this specific file. I have also tried:

- The match on a plain text file, providing the exact text necessary for the match.
- Matching for any text on the original file.
- Matching for any letter on the original file.

Nothing works. Am I overlooking something? Screenshot of the file text is below.

Thanks in advance for any input!

The text in the XLSX File:
Image
ccgthree
 
Posts: 4
Joined: Fri Jan 03, 2020 12:15 pm

Re: Contents Contain Match - Odd Behavior Mon Jan 06, 2020 11:29 am • by Mr_Noodle
What does Hazel's preview show as the condition(s) not matching?
Mr_Noodle
Site Admin
 
Posts: 11247
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Contents Contain Match - Odd Behavior Mon Jan 06, 2020 11:42 am • by ccgthree
Hazel shows the "contents contain match" as not matching any text within the contents of the file. Oddly enough, the contents field within the preview shows no information at all. Could it be a file access issue? Granted it also didn't match anything in the "optimized" test TXT file I threw at it either.

Image
ccgthree
 
Posts: 4
Joined: Fri Jan 03, 2020 12:15 pm

Re: Contents Contain Match - Odd Behavior Mon Jan 06, 2020 11:45 am • by Mr_Noodle
Ah, when using "contain match", Hazel must read the file directly. In this case, though, Hazel can't read XLSX files as they are not text files and are also a proprietary format. If it doesn't work for the text file you used, please show the preview contents for that.
Mr_Noodle
Site Admin
 
Posts: 11247
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Contents Contain Match - Odd Behavior Mon Jan 06, 2020 11:59 am • by ccgthree
Damn. I wondered if that was the case. I recall now (of course) that I was previously converting these to PDF prior to archive. That would have provided Hazel an open format.

For potential learning opportunities, though, here is the preview output for the "optimized" test TXT file. I'm curious as to what I might be overlooking there:

Image
ccgthree
 
Posts: 4
Joined: Fri Jan 03, 2020 12:15 pm

Re: Contents Contain Match - Odd Behavior Mon Jan 06, 2020 12:01 pm • by Mr_Noodle
If that's a newline between "Billing Period" and the date, you should use a space character instead of "anything" (...). "anything" won't match across lines while a space character matches all whitespace, including newlines.
Mr_Noodle
Site Admin
 
Posts: 11247
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Contents Contain Match - Odd Behavior Mon Jan 06, 2020 12:07 pm • by ccgthree
I wondered if that was the case, so I verified the contents of the file manually by retyping it and including it in the screenshot above. No newline in the file that I can see, other than those intended.

https://www.dropbox.com/s/mkwuw4ugevl1bgj/Mahindra%20Floorplan%20Test%20File.txt?dl=0
ccgthree
 
Posts: 4
Joined: Fri Jan 03, 2020 12:15 pm

Re: Contents Contain Match - Odd Behavior Tue Jan 07, 2020 12:53 pm • by Mr_Noodle
Are you using automatic date detection? It may not work in this case with the mix of dashes and slashes. I'd suggest specifying the date format manually.
Mr_Noodle
Site Admin
 
Posts: 11247
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support