The logic behind my search appears at the end of this post.
I effect a Content search for the string "Bonnie" and am rewarded with forty documents in MSWord97.
I have right-clicked on the report's column headings and chosen "Add Column".
From the left pane I have chosen "content".
I scroll down the right-pane and do not find KWIC.
Is there a way for me to display the "content:Bonnie" text of found files?
The foundations of my search:
(1) In the supermarket today I met a lady I knew, but had forgotten her name. One hour later she rolled up at my home to collect gooseberry bushes and daffodils.
(2) I wreaked my brains but could NOT remember her name.
(3) I could remember the name of her dog that I dog-sat twice a few years ago.
(4) Her dog's name is "Maggie", so I searched my monthly diaries (6.5 years so 4,000+ documents) for "maggie" but couldn't find it.
(5) That same year in the fall, I dog-sat "Bonnie", and I could find "Bonnie".
(6) Since I dog-sat Maggie at the same time, the documents with "Bonnie" should also describe my sitting "maggie".
(7) And THAT should lead me to this lady's name.
In typing all that in I have remembered that the dog's name was NOT spelt "maggie", but was something like "megan", without the "n"; still not useful to me.
Right now I reason that if the forty results were accompanied by a column showing, say, thirty characters each side of "Bonnie", then that would help me use my eyes/brain to narrow down the results.
Thanks for any tips
Chris
Suggestion: Add Column, content; KWIC
Re: Suggestion: Add Column, content; KWIC
A KWIC column is a good idea.
Thank you for the suggestion.
I would also like to add highlighting to the preview pane.
There is a convoluted way to do this now with regex, capturing and showing the matching line:
Search for:
*.doc == just search doc files, no need to search every single file.
regex: == enable regular expressions
( ) == capture matching text.
.*bonnie.* == match the whole line that contains bonnie.
add-column:1 == show the matched text in the regmatch1 column.
Thank you for the suggestion.
I would also like to add highlighting to the preview pane.
There is a convoluted way to do this now with regex, capturing and showing the matching line:
Search for:
dm:>2020-01-01 dm:<2025-01-01 *.doc regex:content:(.*bonnie.*) add-column:1*.doc == just search doc files, no need to search every single file.
regex: == enable regular expressions
( ) == capture matching text.
.*bonnie.* == match the whole line that contains bonnie.
add-column:1 == show the matched text in the regmatch1 column.
-
ChrisGreaves
- Posts: 821
- Joined: Wed Jan 05, 2022 9:29 pm
Re: Suggestion: Add Column, content; KWIC
(Clapping both hands!)void wrote: Fri Aug 29, 2025 12:27 amSearch for:
dm:>2020-01-01 dm:<2025-01-01 *.doc regex:content:(.*bonnie.*) add-column:1
Thank you Void,
The image above shows some of the result lines holding "Bonnie"; I have narrowed all the columns except for the Method1 column.
I had found the correct document late yesterday afternoon, which Is why I had narrowed the search to a date-modified within 2023 (saves me time in obtaining results for this response!)
I imagine that for this search/results list the KWIC facade is in easy reach, but that's because I see the results screen as "very close to alignment to 30 characters each side of the keyword".
Or even "... alignment to 20 characters to the left of the keyword and 60 characters to the right of the keyword"
Perhaps there is a regex tweak from a regex expert?
Cheers, Chris
- Attachments
-
- image.png (254.56 KiB) Viewed 2789 times
Re: Suggestion: Add Column, content; KWIC
imagine that for this search/results list the KWIC facade is in easy reach, but that's because I see the results screen as "very close to alignment to 30 characters each side of the keyword".
dm:>2020-01-01 dm:<2025-01-01 *.doc dotall:regex:content:(.{0,30}bonnie.{0,30}) add-column:1dotall: ==
.{0,30} == match the previous element 0 to 30 times.
Or even "... alignment to 20 characters to the left of the keyword and 60 characters to the right of the keyword"
dm:>2020-01-01 dm:<2025-01-01 *.doc dotall:regex:content:(.{0,20}bonnie.{0,60}) add-column:1Adjust the 20 and 60 values as required.
Use (?s) in the regex search as an alternative to dotall:
-
ChrisGreaves
- Posts: 821
- Joined: Wed Jan 05, 2022 9:29 pm
Re: Suggestion: Add Column, content; KWIC
David, if I still lived in the UK I would tell you that I am gob-smackedvoid wrote: Fri Aug 29, 2025 4:55 amOr even "... alignment to 20 characters to the left of the keyword and 60 characters to the right of the keyword"dm:>2020-01-01 dm:<2025-01-01 *.doc dotall:regex:content:(.{0,20}bonnie.{0,60}) add-column:1
Adjust the 20 and 60 values as required.
Use (?s) in the regex search as an alternative to dotall:
The KWIC index and I go back a long way, back to 1973/74 in Adelaide, when I tagged a deck of (20+60=) 80-column punched cards for the 100+ LPs in our collection. I labored until 1984 on a COBOL version of the processor as I migrated around the world between different mainframe OS and supplier versions of COBOL and got my KWIC program down to a standard form.
That, in 24 hours, you produce a method for the most powerful file-finder inside the orbit of Neptune, leaves me in a position of unspeakable praise, so this response must suffice.
Cheers, Chris