Софт-Архив

Textfinder img-1

Textfinder

Рейтинг: 4.2/5.0 (1655 проголосовавших)

Категория: Windows: другое

Описание

File Text Finder Download

specifications

Perform searches within files in order to identify items by a certain keyword, filter the results by file extension, set up multiple search locations, as well as open the items directly from the list with results

File Text Finder is a small software application specialized in searching for files based on a user-defined keyword. The program is able to identify files by performing checks within files’ content.

Store it on portable devices

This is a portable program which makes it the perfect candidate for being saved on USB flash drives or other portable devices. Gaining access to its features requires only opening the executable file because you do not need to follow the steps included in an installation process.

You may uninstall it via a simple deletion task, as it leaves no traces in your Windows registry. It actually saves all settings files on the storage device.

Straightforward layout

File Text Finder impresses with a clean and intuitive design that allows you to tweak the dedicated parameters in a short amount of time. A help manual cannot be found in the package. However, you can venture into tweaking the setup options on your own because they look easy to work with.

File search settings

The application gives you the possibility to manually enter a keyword or paste it from the clipboard, enable the ‘match case’ mode, as well as filter the results by file extension.

What’s more, you are allowed to specify the locations from your computer where File Text Finder conducts the search tasks. The results are displayed directly in the main window and include information about the filename, date when the file was last modified, file size, and full path.

Other important options worth being mentioned enable you to check out statistics about the total number of searched files, found items, as well as unsuccessful items, remove folders from the search process, stop a search task, open the location where a found item is stored, as well as open the selected file from the list with results.

A progress bar is integrated at the bottom of the main window for helping you monitor the status of each search action. Tests have pointed out that File Text Finder carries out a task quickly and without errors. It does not eat up a lot of CPU and memory resources so you do not have to worry that it affects the overall performance of the computer.

Final observations

All things considered, File Text Finder provides a fast, simple, and efficient software solution for helping you identify files in a pile of diverse items based on a custom keyword, and can be configured by rookies and professional alike.

Другие статьи, обзоры программ, новости

QtUiTools 5

Text Finder Example

Dynamically processing forms using Qt UI Tools.

Setting Up The Resource File

The resources required for Text Finder are:

  • textfinder.ui - the user interface file created in QtDesigner
  • input.txt - a text file containing some text to be displayed in the QTextEdit

textfinder.ui contains all the necessary QWidget objects for the Text Finder. A QLineEdit is used for the user input, a QTextEdit is used to display the contents of input.txt. a QLabel is used to display the text "Keyword", and a QPushButton is used for the "Find" button. The screenshot below shows the preview obtained in QtDesigner .

A textfinder.qrc file is used to store both the textfinder.ui and input.txt in the application's executable. The file contains the following code:

For more information on resource files, see The Qt Resource System .

To generate a form at run-time, the example is linked against the QtUiTools module library. This is done in the textfinder.pro file that contains the following lines:

TextFinder Class Definition

The TextFinder class is a subclass of QWidget and it hosts the QWidget s we need to access in the user interface. The QLabel in the user interface is not declared here as we do not need to access it.

The slot on_findButton_clicked() is a slot named according to the Automatic Connection naming convention required by uic .

TextFinder Class Implementation

The TextFinder class's constructor calls the loadUiFile() function and then uses qFindChild() to access the user interface's QWidget s.

We then use QMetaObject 's system to enable signal and slot connections.

The loadTextFile() function is called to load input.txt into QTextEdit to displays its contents.

The TextFinder 's layout is set with setLayout() .

Finally, the window title is set to Text Finder and isFirstTime is set to true.

isFirstTime is used as a flag to indicate whether the search operation has been performed more than once. This is further explained with the on_findButton_clicked() function.

The loadUiFile() function is used to load the user interface file previously created in QtDesigner. The QUiLoader class is instantiated and its load() function is used to load the form into formWidget that acts as a place holder for the user interface. The function then returns formWidget to its caller.

As mentioned earlier, the loadTextFile() function loads input.txt into QTextEdit to display its contents. Data is read using QTextStream into a QString object, line with the QTextStream::readAll () function. The contents of line are then appended to ui_textEdit .

The on_findButton_clicked() function is a slot that is connected to ui_findButton 's clicked() signal. The searchString is extracted from the ui_lineEdit and the document is extracted from textEdit. In event there is an empty searchString. a QMessageBox is used, requesting the user to enter a word. Otherwise, we traverse through the words in ui_textEdit. and highlight all ocurrences of the searchString. Two QTextCursor objects are used: One to traverse through the words in line and another to keep track of the edit blocks.

The isFirstTime flag is set to false the moment findButton is clicked. This is necessary to undo the previous text highlight before highlighting the user's next search string. Also, the found flag is used to indicate if the searchString was found within the contents of ui_textEdit. If it was not found, a QMessageBox is used to inform the user.

main() Function

The main() function initialises the textfinder.qrc resource file and instantiates as well as displays TextFinder .

Написание простой программы с помощью Qt Creator

Написание простой программы с помощью Qt Creator

Замечание: Этот урок подразумевает что пользователь имеет опыт написания простых приложений Qt, проектирования интерфейса пользователя в Qt Designer и использовании системы ресурсов Qt.

В этом примере мы опишем шаги использования Qt Creator для написания маленькой программы Qt, Text Finder. Вдохновлённые примером QtUiTools Text Finder. мы напишем похожую на него но упрощённую версию как показано ниже.

Настройка вашей среды

После того как вы установили Qt Creator, он автоматически определит, находится ли Qt в вашей переменной PATH. Если Qt не находится в вашем PATH. вы можете установить его одним из следующих способов, в зависимости от вашей платформы:

  • На Windows и Linux: в меню Инструменты. в пункте Параметры .
  • В Mac OS X: в Инструменты. пункт Qt4 .

Замечание: Если для сборки Qt вы использовали Visual Studio, все переменные окружения, установленные в Visual Studio, должны быть также установлены для Qt Creator.

Настройка проекта

Мы начнём с проекта Gui приложение Qt4, сгенерированного Qt Creator. Документ Создание проекта в Qt Creator детально описывает этот проект. Не забудьте выбрать QWidget в качестве базового класса Text Finder. Если ваш проект ещё не загружен, вы можете загрузить его выбрав Открыть. из меню Файл .

В вашем проекте будут следующие файлы:

Файлы .h и .cpp содержат необходимые строки кода; файл .pro также завершён.

Заполнение недостающих кусков

Мы начнём с проектирования интерфейса пользователя и затем перейдём к заполнению недостающего кода. В заключение мы добавим поиск.

Проектирование пользовательского интерфейса

Для начала проектирования интерфейса пользователя, щёлкните два раза на файле textfinder.ui в вашем обозревателе проекта. Это запустит интегрированный Qt Designer.

Спроектируйте форму выше с использованием QLabel. QLineEdit (назовите его lineEdit), QPushButton (назовите её findButton) и QTextEdit (назовите его textEdit). Мы рекомендуем вам использовать QGridLayout для расположения QLabel. QLineEdit и QPushButton. QTextEdit можно добавить в QVBoxLayout помимо QGridLayout. Если вы новичок в проектировании форм с Qt Designer. вы можете взглянуть на руководство по Qt Designer .

Заголовочный файл

Файл textfinder.h уже имеет необходимые заголовочные файлы, конструктор, деструктор и объект Ui. Нам необходимо добавить закрытый слот on_findButton_clicked() для выполнения операции поиска. Нам также необходима закрытая функция loadTextFile() для чтения и отображения содержимого входного файла в QTextEdit. Это делается следующим кодом:

Замечание: Объект Ui::TextFinder уже предоставлен.

Файл исходных кодов

Теперь, когда наш заголовочный файл завершён, перейдём к файлу исходных кодов textfinder.cpp. Мы начнём с заполнения функциональности для загрузки текстового файла. Это описано в куске кода ниже:

Мы загружаем текстовый файл используя QFile. читаем его с помощью QTextStream. а затем отображаем его в textEdit с помощью setPlainText(). что требует добавления дополнительных директив #includes в textfinder.cpp:

Для слота on_findButton_clicked() мы извлекаем строку поиска и используем функцию find() для поиска строки в текстовом файле. Это описано в куске кода ниже:

После того как эти функции завершены, мы вызываем loadTextFile() в нашем конструкторе.

Слот on_findButton_clicked() будет вызван автоматически в этой строчке:

в файле ui_textfinder.h. сгенерированном uic.

Файл ресурсов

Нам потребуется файл ресурсов (.qrc ) в котором мы сохраним текстовый файл. Это может быть любой файл .txt с абзацем текста. Чтобы добавить файл ресурсов щёлкните правой кнопкой мыши на Файлы ресурсов в обозревателе проектов и выберите Добавить новый файл. . Вы увидите диалог мастера, показанный ниже.

Введите "textfinder" в поле Имя и используйте заданный Путь. Затем щёлкните Вперёд .

На этой странице вы можете выбрать в какой проект вы хотите добавить новый файл. Убедитесь, что пункт Добавить в проект выбран, а "TextFinder" выбран как Проект. и щёлкните на Завершить .

Ваш файл ресурсов будет отображён в редакторе ресурсов. Щёлкните на выпадающем списке Добавить и выберите Добавить приставку. Приставка, которая нам требуется, это просто косая черта (/ ). Щёлкните на Добавить снова, но на этот раз выберите Добавить файлы. Найдите текстовый файл, который вы хотите использовать, мы будем использовать input.txt .

Снимок экрана выше что вы можете ожидать после того как успешно добавили файл ресурсов.

Сборка и запуск вашего приложения

Теперь, когда у вас есть все необходимые файлы, вы можете скомпилировать вашу программу, нажав на кнопку .

Qt 4

Пример "Text Finder" Настройка файла ресурсов

Ресурсы, требуемые Text Finder:

  • textfinder.ui - файл пользовательского интерфейса, созданного в QtDesigner
  • input.txt - текстовый файл, содержащий какой-нибудь текст для вывода на экран в QTextEdit

textfinder.ui содержит все необходимые для Text Finder объекты QWidget. QLineEdit используется для ввода информации пользователем, QTextEdit - для вывода содержимого input.txt. QLabel - для вывода текста "Keyword", а QPushButton - для кнопки "Find". Снимок экрана ниже показывает предварительный вид, полученный в QtDesigner .

Файл textfinder.qrc используется для сохранения textfinder.ui и input.txt в исполняемом файле приложения. В файле содержится следующий код:

Для получения дополнительной информации о файлах ресурсов смотрите Систему ресурсов Qt .

Для генерации формы во время выполнения пример слинкован вместе с библиотекой модуля QtUiTools. Это сделано в файле textfinder.pro. который содержит следующие строки:

Определение класса TextFinder

Класс TextFinder является подклассом QWidget и служит для размещения объектов QWidget. к которым нам необходим доступ в пользовательском интерфейсе. Метка QLabel пользовательского интерфейса здесь не объявляется, поскольку нам не нужно получать к ней доступ.

Слот on_find_Button_clicked() - слот с именем, согласованным с соглашением имен Автоматического соединения. требуемого для uic .

Реализация класса TextFinder

Конструктор класса TextFinder вызывает функцию loadUiFile(). а затем использует qFindChild() для получения доступа к объектам QWidget пользовательского интерфейса.

Затем используем QMetaObject чтобы разрешить соединение сигналов и слотов.

Функция loadTextFile() вызывается для загрузки в QTextEdit и отображения на экране содержимого файла input.txt .

Компоновка TextFinder 'а устанавливается с помощью setLayout() .

В заключение, заголовок окна устанавливается в значение Text Finder. а isFirstTime в значение true.

isFirstTime используется как флаг для указания повторного выполнения операции поиска. В дальнейшем это объясняется с помощью on_findButton_clicked() .

Функция loadUiFile() используется для загрузки файла пользовательского интерфейса, предварительно созданного в QtDesigner. Создаётся класс QUiLoader и его функция load() используется для загрузки формы в formWidget. который выступает в качестве места расположения пользовательского интерфейса. Затем функция возвращает formWidget туда, откуда была вызвана.

Как рассматривалось выше, функция loadTextFile() загружает файл input.txt в QTextEdit для вывода на экран его содержимого. Данные читаются с использованием QTextStream в объект QString. line. с помощью функции QTextStream::readAll (). Содержимое line затем добавляется в ui_textEdit .

Функция on_findButton_clicked() - это слот, который соединён с сигналом ui_findButton 'а, clicked(). searchString извлекается из ui_lineEdit. а document извлекается из textEdit. В случае если searchString пустой, используется QMessageBox. запрашивающий у пользователя ввод слова. В противном случае, мы проходим по словам в ui_textEdit. и подсвечиваем все вхождения searchString. Используются два объекта QTextCursor. Один для перебора слов в line и другой - для отслеживания редактирования блоков.

Флаг isFirstTime устанавливается равным false в тот момент, когда щелкают findButton. Это необходимо для отмены предыдущего подсвечивания текста перед подсвечиванием следующей искомой строки пользователя. Кроме того, флаг found используется для указания если searchString была найдена внутри содержимого ui_textEdit. Если она не была найдена, то используется QMessageBox для информирования пользователя.

Функция main()

Функция main() инициализирует файл ресурсов textfinder.qrc и присваивает значения также, как и выводит на экран TextFinder .

Qt 4

Text Finder Example Setting Up The Resource File

The resources required for Text Finder are:

  • textfinder.ui - the user interface file created in QtDesigner
  • input.txt - a text file containing some text to be displayed in the QTextEdit

textfinder.ui contains all the necessary QWidget objects for the Text Finder. A QLineEdit is used for the user input, a QTextEdit is used to display the contents of input.txt. a QLabel is used to display the text "Keyword", and a QPushButton is used for the "Find" button. The screenshot below shows the preview obtained in QtDesigner .

A textfinder.qrc file is used to store both the textfinder.ui and input.txt in the application's executable. The file contains the following code:

For more information on resource files, see The Qt Resource System .

To generate a form at run-time, the example is linked against the QtUiTools module library. This is done in the textfinder.pro file that contains the following lines:

TextFinder Class Definition

The TextFinder class is a subclass of QWidget and it hosts the QWidget s we need to access in the user interface. The QLabel in the user interface is not declared here as we do not need to access it.

The slot on_find_Button_clicked() is a slot named according to the Automatic Connection naming convention required by uic .

TextFinder Class Implementation

The TextFinder class's constructor calls the loadUiFile() function and then uses qFindChild() to access the user interface's QWidget s.

We then use QMetaObject 's system to enable signal and slot connections.

The loadTextFile() function is called to load input.txt into QTextEdit to displays its contents.

The TextFinder 's layout is set with setLayout() .

Finally, the window title is set to Text Finder and isFirstTime is set to true.

isFirstTime is used as a flag to indicate whether the search operation has been performed more than once. This is further explained with the on_findButton_clicked() function.

The loadUiFile() function is used to load the user interface file previously created in QtDesigner. The QUiLoader class is instantiated and its load() function is used to load the form into formWidget that acts as a place holder for the user interface. The function then returns formWidget to its caller.

As mentioned earlier, the loadTextFile() function loads input.txt into QTextEdit to display its contents. Data is read using QTextStream into a QString object, line with the QTextStream::readAll () function. The contents of line are then appended to ui_textEdit .

The on_findButton_clicked() function is a slot that is connected to ui_findButton 's clicked() signal. The searchString is extracted from the ui_lineEdit and the document is extracted from textEdit. In event there is an empty searchString. a QMessageBox is used, requesting the user to enter a word. Otherwise, we traverse through the words in ui_textEdit. and highlight all ocurrences of the searchString. Two QTextCursor objects are used: One to traverse through the words in line and another to keep track of the edit blocks.

The isFirstTime flag is set to false the moment findButton is clicked. This is necessary to undo the previous text highlight before highlighting the user's next search string. Also, the found flag is used to indicate if the searchString was found within the contents of ui_textEdit. If it was not found, a QMessageBox is used to inform the user.

main() Function

The main() function initialises the textfinder.qrc resource file and instantiates as well as displays TextFinder .

Qt 4

Text Finder Example Setting Up The Resource File

The resources required for Text Finder are:

  • textfinder.ui - the user interface file created in QtDesigner
  • input.txt - a text file containing some text to be displayed in the QTextEdit

textfinder.ui contains all the necessary QWidget objects for the Text Finder. A QLineEdit is used for the user input, a QTextEdit is used to display the contents of input.txt. a QLabel is used to display the text "Keyword", and a QPushButton is used for the "Find" button. The screenshot below shows the preview obtained in QtDesigner .

A textfinder.qrc file is used to store both the textfinder.ui and input.txt in the application's executable. The file contains the following code:

For more information on resource files, see The Qt Resource System .

To generate a form at run-time, the example is linked against the QtUiTools module library. This is done in the textfinder.pro file that contains the following lines:

TextFinder Class Definition

The TextFinder class is a subclass of QWidget and it hosts the QWidget s we need to access in the user interface. The QLabel in the user interface is not declared here as we do not need to access it.

The slot on_find_Button_clicked() is a slot named according to the Automatic Connection naming convention required by uic .

TextFinder Class Implementation

The TextFinder class's constructor calls the loadUiFile() function and then uses qFindChild() to access the user interface's QWidget s.

We then use QMetaObject 's system to enable signal and slot connections.

The loadTextFile() function is called to load input.txt into QTextEdit to displays its contents.

The TextFinder 's layout is set with setLayout() .

Finally, the window title is set to Text Finder and isFirstTime is set to true.

isFirstTime is used as a flag to indicate whether the search operation has been performed more than once. This is further explained with the on_findButton_clicked() function.

The loadUiFile() function is used to load the user interface file previously created in QtDesigner. The QUiLoader class is instantiated and its load() function is used to load the form into formWidget that acts as a place holder for the user interface. The function then returns formWidget to its caller.

As mentioned earlier, the loadTextFile() function loads input.txt into QTextEdit to display its contents. Data is read using QTextStream into a QString object, line with the QTextStream::readAll () function. The contents of line are then appended to ui_textEdit .

The on_findButton_clicked() function is a slot that is connected to ui_findButton 's clicked() signal. The searchString is extracted from the ui_lineEdit and the document is extracted from textEdit. In event there is an empty searchString. a QMessageBox is used, requesting the user to enter a word. Otherwise, we traverse through the words in ui_textEdit. and highlight all ocurrences of the searchString. Two QTextCursor objects are used: One to traverse through the words in line and another to keep track of the edit blocks.

The isFirstTime flag is set to false the moment findButton is clicked. This is necessary to undo the previous text highlight before highlighting the user's next search string. Also, the found flag is used to indicate if the searchString was found within the contents of ui_textEdit. If it was not found, a QMessageBox is used to inform the user.

main() Function

The main() function initialises the textfinder.qrc resource file and instantiates as well as displays TextFinder .

Arduino Playground

Text Finder library

TextFinder is a library for extracting information from a stream of data. It was created to be used with the Arduino Ethernet library to find particular fields and get strings or numeric values. It can also be used with Serial data.

The download includes example sketches illustrating how to use the library with ethernet clients and servers, as well as with serial data.

To use TextFinder. you create an ‘instance’ for the stream you want to processes. For example, the following fragment is based on the Ethernet client example sketch distributed with Arduino. That sketch does a google search on the term arduino. The following code adds functionality to print the number of hits reported by google.

Add these lines before setup:

Modify the connection code as follows:

The remainder of the sketch can be as in the distributed example. The find method reads data from the client until it finds the string: "Results <b>" It then looks for the string: "of about <b>" And the getValue method returns the next numeric value.

The parsing is done without using a buffer so there is no way to go back through data that has already been read.

Here are the supported methods:

The constructor is given the client stream instance to process. The timeout is the number of seconds to wait for the next character before aborting the find and get methods. The default is 5 seconds if no timeout is given.

This reads from the stream until the given target is found. It returns true if the target string is found. A return of false means the data has not been found anywhere in the stream and that there is no more data available. Note that TextFinder takes a single pass through the stream, there is no way to go back to try and find or get something else (see the findUntil method ).

As above but the search will stop if the terminate string is found. Returns true only if target is found. This is useful to stop a search on a keyword or terminator. For example,

will try to seek to the string “value” but will stop at the first blank line (a newline followed immediately by a carriage return). This enables a search for another term to proceed from the place the terminator was found.

Returns first valid (long) integer value. Leading characters that are not digits or minus sign are skipped. The integer is terminated by the first non-digit character (other than commas, which are discarded)following the number. If no digits are found the function returns 0.

As getValue above but the given skipChar is ignored. This allows format characters (for example commas in values) to be ignored.

float version of getValue

float version that can ignore skipChars

Finds the pre_string and then puts the following characters into the given buffer until the post_string is detected. The end of string is determined by a match of a character to the first char post_string. String longer than the buffer length are truncated to fit. The function returns the number of characters placed in the buffer (0 means no valid data found)

Text-finder Plugin - Jenkins - Jenkins Wiki

Text-finder Plugin

2015-Oct 5347

2015-Nov 5362

This plugin lets you search keywords in the files you specified and use that to downgrade a "successful" build to be unstable or a failure.

This is handy when you have some tools in your build chain that don't use the exit code properly.

Comments (9)

I just added the plug to hudson 1.386 And check the following: "Hudson Text Fin.

I just added the plug to hudson 1.386

And check the following: "Hudson Text Finder" "Also search the console output" and"Unstable if found"

and I added as regex "BUILD_FAILED" w/o quotes. My test script it echoes "BUILD_FAILED" and I see the message in the console output,

However the jobs still is failed (red). I tried adding "BUILD_FAILED" with quotes and even ".*" w/o quotes and still fails.

Please help what I'm doing wrong.