Re: OT: tcl/tk GUI app
- From: Fred James <fredjame fredjame cnc net>
- To: gtk-list gnome org
- Subject: Re: OT: tcl/tk GUI app
- Date: Thu, 17 Jan 2013 19:36:21 -0500
Georgios Petasis wrote:
if {$dir ne ""} {
# your action here...
}
Georgios Petasis
Thank you ... at least with that, so far I can display the selected
directory in the main window ... that is more than I had.
(for those not interested ... you may easily stop reading here ... thank
you)
What is the action, you ask?
(1) enter a search string (exact match, but not case sensitive)
(2) select a starting directory
(3) search recursively from there
(3.1) search first for a list of files ending in *.odt
(3.2) search each file on the list (found in 3.1) for the string
(3.2.1) make a list of matches
(3.2.2) display the match list in a scroll box
... or some variation of that.
I have odt2txt (downloaded and running), and I have a couple of (BASH)
shell scripts that complete the set. I put all three in /usr/bin. The
set works like this ...
(1) in a terminal window
(1.1) cd to /desired/path
(1.2) enter the following: searchODT string [string [string ...
[string]]]
(1.2.1) that is, at least 1 and up to 9 space separated arguments
(hard coded arbitrary limit)
(1.3) searchODT sorts out the string, combining all arguments into
one string
(1.4) searchODT calls depthODT, which generates the list (file) of
*.odt files
(1.3.1) search is recursive beginning at the 'pwd' where the
original searchODT command was issued
(1.4) searchODT then calls odt2txt for each entry in the list (file)
(1.4.1) the output from odt2txt is grep'd for the string(s) (grep -i)
(1.4.2) matches are put into another file for display
(1.4.2.1) it is possible to use: more, soffice, kwrite (and I am
sure others) for the display.
Other than argument count, there is basically no error checking at the
moment.
(scripts available, if interested)
The original project was to done to help my spouse, because dolphin
(file manager) doesn't seem to be able to search inside OOo documents?
And the current version functions well enough. But I though I might be
able to use this opportunity to learn some more tcl/tk.
Thank you for your help
Regards
Fred James
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]