IDM PowerTips

Column Based Find and Replace

Have you ever wanted to search for data in specific column ranges? UltraEdit/UEStudio’s column-based search does just that.. UltraEdit/UEStudio allows you to restrict your search by column range, giving you the ability to search for literal strings and even regular expressions in specific columns.

Step 1: Determine the Column Range

The first step is to determine the column range that we wish to restrict the search to.

For the purposes of this power tip, we are using address information as shown in the screenshot. We are going to search for people who live in Ohio (postal code OH). The column that contains the postal codes is in the range of 51 – 53.

You can easily find the column range using the Ruler at the top of the edit window or by checking the column number in the status bar.

Writing a Macro<br />

Please note: If you are using the status bar, you can see the entry for the column number following the “Col.”. You will need to subtract 1 from the number here because it is showing you the column that text will be entered into when you next type.

Writing a Macro<br />

Step 2: Do the Search

Open the find dialog from the Search menu, toolbar, or by hitting CTRL + F. To access the Search in Column feature, you will need to click on the Advanced button to expand the advanced options.

Enable (Click) the option to Search in Column and type your column range. For our example, we are using 51 and 53.

Writing a Macro<br />

Now, when you click Next (or hit Enter), you will see that the text is matched only in the specific column range.

As you can see in our example, OH is matched in column 51-53, but not it the other instances of “oh” – such as in the name “John” on the first and second lines of the file.

Writing a Macro<br />

Replace in Columns

The same technique as above also applies to the column based replace.

Writing a Macro<br />