Contains Match for Custom Table numeric value not matching

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

Moderator: Mr_Noodle

Hello,

What I'm trying to achieve
I want to file all my scanned receipts by the credit/debit account billed according to the payment device that was used, e.g. AMEX xxx1234, Mastercard xxx5678.

We have a number of combinations to match (All Accounts x His/Hers x Card/iPhone/iPad/Watch) and this list gets updated with every iOS/iPadOS/watchOS update or new card, etc. The CSV file is exported from Numbers using UTF-8 encoding (the default).

The Problem I'm Seeing
When using a Contains Match rule with a Custom Table that matches on 'Card Type' and 'Last Digits', it does not match the last digits in all cases. Rule Preview shows a Green Tick for Card Type and a Red Cross for Last Digits.

Observations
1. For the failing cases, if I open the OCR'd PDF receipt in Preview, I can search for the Last Digits and it finds them.

2. Neither of these command-lines find the matching terms:
Code: Select all
strings /path/to/receipt.pdf | grep -i Mastercard
strings /path/to/receipt.pdf | grep 5678


3. Spotlight works fine - both of these find the file:
Code: Select all
mdfind Mastercard | grep /path/to/receipt.pdf
mdfind 5678 | grep /path/to/receipt.pdf


4. GhostScript can find the text:
Code: Select all
gs -sDEVICE=txtwrite -o contents.txt /path/to/receipt.pdf
grep -i mastercard contents.txt # works
grep -i 5678 contents.txt # works


What else can I do to troubleshoot/diagnose the issue?
jbrwilkinson
 
Posts: 13
Joined: Sun Aug 14, 2016 5:46 pm

Open the PDF in preview, select the text in question, copy it and paste it into a text editor. How does the text appear there?
Mr_Noodle
Site Admin
 
Posts: 11230
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Looks like this:

Code: Select all
Total '- ” MasterCard Contactless
Sale Transaction VERIFIED’BY“DEVICE MASTERCARD
Card No: *7t*x**^W****5678


(Receipts are notoriously poor quality and don't OCR so well)

Is the issue the ****'s ?
jbrwilkinson
 
Posts: 13
Joined: Sun Aug 14, 2016 5:46 pm

Can you post a screenshot of your rule? You can't post images directly here so you'll need to use a file sharing service. If you aren't using one already, you can try imgur.com
Mr_Noodle
Site Admin
 
Posts: 11230
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron