Home
Power Search and Replace Tool Prev Page Prev Page
Introducing PowerGREP
Getting Started with PowerGREP
Regular Expression Quick Start
PowerGREP Contact Information
How to Use PowerGREP
Mark Files for Searching
Define a Search Action
Interpret Search Results
Edit Files and Replace or Revert Individual Matches
Keyboard Shortcuts
PowerGREP Examples
Search Through File Names
Find Email Addresses
Find Word Pairs
Boolean Operators “and” and “or”
Find Two Words Near Each Other
Find Two or More Words on The Same Line
Extract or Delete Lines Matching One or More Search Terms
Delete Repeated Words
Add a Header and Footer to Files
Update Copyright Years
Add Proper HTML <TITLE> Tags
Replace HTML Tags
Replace HTML Attributes
Search Through or Skip Source Code Comments and Strings
Convert Windows to UNIX Paths
Extract Data into a CSV File or Spreadsheet
Collect a List of Header and Item Pairs
Inspect Web Logs
Extract Google Search Terms from Web Logs
Compile Indices of Files
Make Sections and Their Contents Consistent
Generate a PHP Navigation Bar
Include a PHP Navigation Bar
PowerGREP Reference
PowerGREP Assistant
File Selector Reference
File Selector Menu
Action Reference
Search Terms and Options
Action Definition
Extra Processing
File Sectioning
Target and Backup Files
Action Menu
Library Reference
Library Menu
Results Reference
Results Menu
Editor Reference
Editor Menu
Undo History Reference
Undo History Menu
Change PowerGREP’s Appearance
Preferences
Path Placeholders
Supported File Formats
Command Line Parameters
XML Format of PowerGREP Files
Regular Expression Tutorial
Introduction
Tutorial Contents
Characters
How a Regex Engine Works Internally
Character Classes
Dot (Any Character)
Start and End of String or Line
Word boundaries
Alternation
Making a Token Optional
Quantifiers (Repetition)
Grouping and Backreferences
Named Capturing Groups
Unicode
Mode Modifiers
Atomic Grouping and Possessive Quantifiers
Lookahead and Lookbehind
Test The Same Part of The String for More Than Once
Continuing from The Previous Match
If-Then-Else Conditionals
Adding Comments
Regular Expression Reference
Basic Syntax
Advanced Syntax
Flavor-Specific Syntax
Unicode Syntax
Regular Expression Examples
Regular Expression Examples
Floating Point Numbers
Dates
Matching Complete Lines
Delete Duplicate Lines
Programming Language Syntax
Two Near Words
Regex Tools and Languages
Overview
grep
RegexBuddy
EditPad Pro
Delphi
Java
Java Example
JavaScript
JavaScript Example
.NET (C# and VB.NET)
C# Example
PCRE
Perl
PHP
Python
Ruby
Regular Expression Books
Teach Yourself...in 10 Minutes
Mastering Regular Expressions
Java Regular Expressions
Regular Expression Recipies

Action Menu

The Action menu lists commands for use with the Action pane. See the Action reference topic for more information on the Action pane itself.

Clear

Clears all settings on the Action pane. Clearing the action reduces clutter, which makes it easier to start with a completely new action definition.

Open

Loads the file selection and action definition from a PowerGREP action file that you previously saved. Both the current file selection and action will be replaced with those saved in the file. PowerGREP results files also contain file selection information. If you select a results file, only the file selection and action information will be read from the file.

You can quickly reopen a recently opened or saved action file by clicking the downward pointing arrow next to the Open button on the Action toolbar. Or, you can click the right-pointing arrow next to the Open item in the Action menu. A new menu listing the last 16 opened or saved files will appear. Select "Maintain List" to access the last 100 files.

Save

Save the current file selection into a PowerGREP file selection file. You will be prompted for the file name each time.

All settings you made in both the File Selector and the Action pane will be saved. If you want to save the action definition only, without the file selection, consider adding the action to a PowerGREP Library instead.

Action files are appropriate for actions that you execute repeatedly, in exactly the same way. Action files can be executed from the command line. You can even generate them with other applications. Use Libraries to store boilerplate action definitions for later adaptation.

Favorites

If you often open the same files, you should add them to your favorites for quick access. Before you can do so, you need to save the action to a file. PowerGREP's window caption will then indicate the name of the action file. Click the downward pointing arrow next to the Favorites button on the Action toolbar, or the right-pointing arrow next to the Favorites item in the Action menu. Then select "Add Current Action" to add the current action file to the favorites. Pick a file from the menu to open it.

If you click the Favorites button or menu item directly, a window will pop up where you can organize your action favorites. If you have many favorites, you can organize them in folders for easier reference later.

Preview

Click the Preview button on the Action toolbar, or press F9 on the keyboard, to execute the action without creating or modifying any files. Previewing an action is always perfectly safe. It will never do anything that you might regret later.

You should make a habit of using the Preview button rather than the Execute button, even when displaying search matches or when you set the target type to "do not save results to file". In those situations, the Preview and Execute buttons do exactly the same. Still, you should use the Preview button, just in case you made a mistake when preparing the action you are about to execute.

That said, as long as you tell PowerGREP to keep backup copies, any action, except deleting files, can be undone.

When you preview an action, PowerGREP will show detailed search results on the Results pane.

Execute

The Execute item in the Action menu executes the action for real. If the target type calls for files to be created or modified, executing the action will do so. PowerGREP will show detailed search results on the Results pane.

On the Action toolbar, the Execute button is not labeled "Execute". Instead, it is labeled "Search", "Copy Files", "Move Files", Delete Files", "Replace" or "Collect" depending on the action type and target type you've chosen. The "Search" label is used for all actions that will not modify any files. All other labels indicate that the action will create and/or modify files.

You can speed up executing an action for real after you've previewed it by turning on the option to search only through files with results. If you know none of the files were modified since you did the preview, turn on this option so PowerGREP doesn't needlessly search files without matches again.

Quick Execute

The Quick Execute item in the Action menu executes the action for real, without keeping individual match results. The Results pane will only show how many matches were found in each file. Files will be created or modified according to the target type.

Just like the Execute button, the Quick Execute button on the Action toolbar changes its label depending on the action type and target type you've chosen. The "Quick Search" label is used for all actions that will not modify any files. All other labels indicate that the action will create and/or modify files.

Quick Execute is significantly faster than Execute or Preview, and will use far less of your computer's memory. That's because it doesn't have to keep track of each individual match to be able to show you all the details on the Results pane. If you don't plan to inspect the search results, Quick Execute is the way to go.

When preparing a new action that you plan to execute on a large number of files, or some very large files, you should first preview the action on just a couple of the files. When you're confident the action works the way it should, expand the file selection to all the files, and use Quick Execute to execute it for real.

Abort

Aborts the action that is being preview or executed. The Results pane will show the portion of the results that had already been collected. Aborting the action does not automatically undo its effects. Files that had already been modified will not be reverted. Files that had already been created will not be deleted. The partially executed action will be added to the Undo History, where you can undo its effects.

If an action doesn't seem to be doing what you intended, click the Abort button, inspect the results gathered so far, undo the action's effects, correct the action definition, and execute it again.

Add to Library

Adds the current action definition to the PowerGREP Library. Unlike saving an action, which saves both the action definition and file selection, only the action definition itself is added to the library. You don't need to save the action before adding it to the library. A copy of the entire action definition is stored in the library file itself.

Only valid action definitions can be added to libraries. If something is amiss, error message will appear. Correct the error, and try adding the action to the library again.

 

Visit the best online web design and script resources