Search in whole directory

Top  Previous  Next

Examples > GrepUrls > Search in whole directory

 

As usual you can load a html file into the input window of the TextTransformer, to process it. But now it shall be demonstrated, how to work with the files of a whole directory. In our case, these would be all documents of a web site.

 

To do this the transformation manager is invoked. Most comfortably this is done by the button:

 

MultiFile

 

If the project isn't compiled yet, it will compile now automatically, before the transformation manager dialog opens. How to work with the transformation manager is explained in detail in an own chapter of this help. Here only the most important steps to make a management are presented briefly.

 

You also can find the ready management in:

 

C:\Program Files\TextTransformer.113b\Examples\GrepUrls\GrepUrls.ttm

 

 

If you intend in future, too, to work on HTML pages, it is advisable to define a filter just now for this file type. This filter then can be used again and again at the choice of source files in the TextTransformer.

 

First the folder with the source files has to be chosen. For this example some of the html files from the web site of boost were copied into the UrlGrep directory:

 

By the button

 

AddFolder

 

you can open a dialog to chose the target directory:

 

TM_SelectDir_en

 

After the choice was confirmed, a new row is inserted in the table of the source files/folders. The recursively box can be activated now in this row to search the files of the sub-folders too. If, as recommended above, the filter was defined for HTML files, this can be selected in the choice box of the column file name or filter now. However, the filter  "*.htm; *.html" can be written also directly to the field.

 

 

TM_Sources_en

 

 

On the Transformation-Options page of the transformation manager you have to set now, that a N:1 transformation is planned. That means, that all results of the transformations of the source files shall be written into a single target file.

 

By the button

 

SelectPath_btn

 

then a dialog is opened, by which you can navigate to the desired target folder. Then you can either select an existing file a s target or input a new filename.

 

 

TM_SelectSingletarget_en

 

 

A preview is shown on the next page of the transformation manager now, where you can see in the different rows of a table, which source files can contribute to the file to be produced.

 

TM_Preview_en

 

Now you can start the search for the addresses:

 

StartTransformationButton

 

 

By a double click on an arbitrary row in the table on the reult page, the transformation manager will be closed and the resulting text is shown in the output window of the IDE:

 

 



This page belongs to the TextTransformer Documentation

Home  Content  German