Our office has an indexed field for parcel numbers. They should look something like 12345678. I have found a few that have been added as 123-456-78 instead. When I attempt to run a query to find the dash, I get an error. what can I put into the advanced search to find the dash or any other special character?
Question
Question
Searching for special characters
Replies
Hi Michael,
What is the search syntax that it uses? and what version of Laserfiche use?
regards,
Marco.
It would be helpful to provide an example screenshot or search syntax so we can understand how you are performing the search. Also, are you trying to find a specific package number, or find all the incorrectly formatted ones?
Because your specific field is indexed, you cannot search for the dash directly, but you can search for cases where some special character (including spaces) is between the number.
To search for anything of the format ###-###-##, you could use wildcards as follows within your specific field:
"[0-9][0-9][0-9] [0-9][0-9][0-9] [0-9][0-9]"
Which says "any digit 0-9" in a pattern of 3,3,2 where they are separated by any non-indexed character (examples: @ , ; l - +). This should successfully return all the parcel numbers formatted that was, like 123-456-78 and 456-123-78.
This would also return things like:
- 123.456.78 (dots instead of a dash)
- 123 456 78 (spaces instead of a dash)
- 123.456@78 (random special characters instead of a dash)
That said, I'm confused as to why a field with a standard numerical format is (1) a text type and (2) indexed. Using either a number field with constraints or an integer field would help ensure uniformity of data entry.
At the least, making the field non-indexed means you can search on some special characters such as the dash. Changing a field from indexed to non-indexed is a simple step, so I'd recommend starting there if you can.
If you want to convert over an existing field, there are a few ways to do so and I think it has been covered before here on Answers.
Thanks for the suggestions. Using the pattern "[0-9][0-9][0-9]-[0-9][0-9][0-9]*" worked well. Still not sure how to search for special characters that don't fit the pattern (semicolon, slash, etc.) but that is a much smaller issue.
The guy who set this up in 2005 really didn't understand database design - he was a hardware guy. I inherited this repository in 2014 and am stuck with a bunch of terrible templates, bad field types, nonsense for a folder structure, and a non-existant records retention policy.
The end users have finally started to understand they have a bunch of files they will be hard pressed to find because of poor planning in the beginning.