# UltraEdit

## Contents

Description
Where to Find UltraEdit
UltraEdit: Instructions
Common Problems
Other Resources
If You Still Need Help

## Description

UltraEdit is an MS-Windows editor for data and programming. It is particularly useful for handling large data files and for column-oriented data entry operations. It is available in a 16-bit version for Windows 3.x and a 32-bit version for Windows 95. The features of both products are nearly identical.

Contents

## Where to Find UltraEdit

UltraEdit can be used in the Research Data Management Services (RDMS) Data Center (accessible from 002 Smith Hall), or can be downloaded directly from the UltraEdit Home Page. UltraEdit has a free 45-day trial period. After that you should register your copy with IDM Software. Registration cost is currently $30.

Contents

## UltraEdit: Instructions

UltraEdit contains many useful features for creating numerical data files and for programming. A brief list is included below. Many of these capabilities may be invoked via "hot keys" (a sequence of keys pressed at one time) or by clicking the right mouse-button.

### Simple Example of Data Entry

### Advanced Features Useful for Data Entry

- Advanced Search Capability
- Bookmarking
- File Sorting
- File Insertion
- Macros
- Column Mode
- Viewing More than One File at a Time
- Format Conversions

### Special Features for Programmers

- Keyword Color Coding
- DOS Command Spawning Ability

Contents

### Simple Example of Data Entry

This example shows you how to create a data file. It uses the following UltraEdit features:

- Displaying the column indicator (ruler)
- Displaying line numbers
- Inserting a line in an existing file
- Deleting a line (or line range) from an existing file
- Searching for numerical or character data
- Searching and replacing
- Restricting replacements to specific columns
- Sorting based on column range
- Moving around in the file
- Undoing changes

#### Step 1. Creating the working environment

1. Select View / Display Ruler to display the column indicator.
2. Set the line number viewer by choosing View / Display Line Numbers.

#### Step 2. Entering and saving data

1. Begin typing your data:
   - Separate data fields with spaces if you wish.
   - Align the first character of each field with the one above it in its column. A typical example might look like this:
     `164 681 06 01 680.0 678.3
     164 681 06 04 677.4 678.4
     164 681 06 03 677.3 677.1
     164 681 06 04 676.4 676.7
     164 681 06 08 678.6 673.8
     164 681 06 06 671.7 670.4
     164 681 06 07 674.8 673.8
     `
2. Save your file by choosing File / Save.

Although this example only uses columns 1-25 for its sample data, UltraEdit can edit files of unlimited line width without wrapping or splitting the lines.

#### Step 3. Editing your data file

1. Inserting a new line
   - Move to the line where the insertion will take place
   - Place the cursor at the beginning of the line by pointing the mouse cursor to the left of the line number and clicking the left mouse button
   - Press the ENTER key to create an opening at that line.
   - Type in the new data.
2. Deleting line(s)
   - Single lines
     - Move your cursor to the line to be deleted
     - Select Edit / Delete Line, or press CTRL-E. The lines below automatically shift up to fill the gap.
   - Multiple lines
     - Go to the beginning of the first line to be deleted.
     - Holding down the left mouse button, drag the cursor straight down the file until every line that is to be deleted is selected. UltraEdit automatically selects the entire line (unless you are in column mode).
     - Press the DELETE key.
3. Searching
   - Choose Search / Find.
   - Enter the string, character or number you wish to search for.
   - Select which direction to search and finish choosing your options.
   - Click on OK. If the program finds your field, it will highlight it and prompt you whether to find the next one, the previous one, or to stop searching.
4. Replacing
   - General
     - Select Search / Replace.
     - Enter the string, character or number you wish to search for.
     - Type the replacement field.
     - Complete the options on the popup menu
       .
   - Restricted to a column range
     - Choose Column / Column Mode.
     - Place the cursor on the first row at the beginning of the first column in the column range. If you only want to search from a row in the middle of the file, position the cursor in that row.
     - Select (highlight) the entire search range
       - Press the SHIFT key and hold it down.
       - Without letting go of the SHIFT key, use the left mouse button to drag the right window scrollbar until you reach the bottom of the page.
       - Still holding the SHIFT key down, click on the end of the last field in the column range with the left mouse button. You can now let go of the SHIFT key. The entire column range will now be highlighted.
     - Choose Search / Replace.
     - Complete the options on the popup menu, being sure to choose Selected Text under Replace Where. Note that you can only perform a Replace All in a column-restricted Search and Replace.

     > WARNING: Once column mode is activated, it will remain on until you turn it off. Having column mode turned on affects several aspects of UltraEdit's operation, (e.g., the ability to delete lines). Choose Column / Column Mode to turn off column mode.

5. Sorting
   - Using the ruler, determine the starting column number of the sort range.
   - Choose File / Sort / Advanced Sort/Options....
   - Complete the popup menu, including the column number of the sort range. You may put the cursor in the desired column, rather than typing its number directly.
   - Press ENTER or click on Sort.

     > NOTE: Under certain circumstances, version 4.40b adds a blank line at the end of your file after a sort has been completed. This happend when the sort selection does not end at the beginning of a line, or the file does not end with a return.

6. Moving around

   > UltraEdit does not have as many shortcuts for getting around as many other data editors, but supports typical windows cursor movement mechanisms.

   - Moving up or down in the file
     - Scrolling: Move the cursor to the box in the right scroll bar. Press the left mouse button and hold it down. Now drag the box up and down to scroll up and down in the document. You could also use the arrow keys on your keyboard.
     - Jumping: Move the cursor to the box in the right scroll bar. Left-click your mouse above the box to move up one screen at a time; click below it to move down. Alternatively, you could use the PAGE UP and PAGE DOWN keys.
   - Moving left or right in the file

     > Same as above, only using the bottom scroll bar.

   - Line movement:
     - Press the END key to get to the end of a line.
     - Press the HOME key to get to the beginning of a line.
     - Press CTRL and the left or right arrow key to move backward or forward one word at a time.
7. Undoing changes
   - Undo

     > UltraEdit's Undo feature (Edit menu) is not a toggle. It keeps track of every alteration in the order in which it was made. In other words, if you have made five consecutive mistakes, then selecting Undo five times will undo the damage.

   - Backups

     > UltraEdit automatically creates a backup every time you save your file. These files have the same name as your file, but with a .BAK extension (e.g., myfile.BAK).
     > WARNING: If you have two files with identical root names you will not be able to distinguish which file has been backed up. For example, if you had a file named TEST.DAT and a file named TEST.CPP, UltraEdit would make one backup file, TEST.BAK, and overwrite it every time you saved one file or the other.

UltraEdit Instructions
Contents

## Advanced Features Useful for Data Entry

### Advanced Searches

UltraEdit is equipped with a number of advanced search abilities, including:

- Find
  - Find next
  - Find previous
  - Find within column (see Column Mode below)
  - Find in file (similar to `grep` in UNIX)
- Replace
  - Replace all
    - from top of file
    - from current cursor position
    - for entire file
    - for selected text
  - Prompted replace
  - Replace in files

NOTE: It is not currently possible to perform a Prompted Search and Replace while in column mode. It is, however, possible to perform a Replace All .

UltraEdit remembers your previous ten searches (configurable). It also lets you use "regular expressions" as part of the search string to specify the search string more precisely.

####

Regular Expressions

"Regular expressions" are a combination of search strings and special characters, such as wildcards, spaces or other bits of information that may make your search more specific. For example, the "?" character is a wildcard representing any one letter or number. Therefore the Find expression m?n matches "man", "men", and "min" but not "moon".

For information on more complex regular expressions, select Help / Index / Search from the pulldown menu bar, then type `find` in the dialogue box.

UltraEdit Instructions
Contents

### Bookmarking

Bookmarking refers to the practice of placing markers at various locations in a document so that you may quickly return to them. Marking lines in this way enables you to move easily through very large files. It also lets you save the location of a search result so that you don't have to repeat a previous Find to return there. Bookmarks are displayed as highlighted lines in the file. You cannot bookmark columns, but you can use column numbers or markers to keep track of your place in column mode. UltraEdit allows an unlimited number of bookmarks.

To create a bookmark in your file, simply

- Go to the line you wish to mark.
- Select the Search / Toggle Bookmark menu item
  or press CTRL-F2.

The line indicated should now be highlighted. You may repeat this process as many times as you wish, and each time the former bookmarks will remain highlighted.

To move from bookmark to bookmark, press F2. Alternatively, choose the Search / Next Bookmark menu items.

To remove a bookmark, move your cursor to the bookmark you wish to remove and repeat the process you used to create it. The CTRL-F2 is a toggle that turns bookmarks on and off.

NOTE: Bookmarks do not persist after you exit UltraEdit. You will have to reset them every session.

UltraEdit Instructions
Contents

### File Sorting

UltraEdit supports a number of file sorting options, including:

- Order
  - Ascending
  - Descending
- Column . . .
  - of current cursor position
  - designated by number
- Duplicate removal
- Case sensitivity

To run a Sort,

- Select the File pulldown menu
- Select Sort
  - Choose Sort File (Using Current Options), or
  - Choose Advanced Sort/Options.
    - Edit the appropriate options.
    - Click Sort.

The data should now be sorted according to your specifications.

UltraEdit Instructions
Contents

### File Insertion

You can insert the contents of one file into the file you are currently editing. To do this,

- Put the cursor at the beginning of the line where you want the file inserted.
- Select the File / Special / Insert File menu items.
- From the dialog box, choose the file you want to insert and click Open.

> NOTE: The file is actually inserted one line above where you place the cursor.

#### TIP:

Note that the file being imported may have some of its formatting altered. For example, inserting some source code (e.g., Fortran, C)into the top of, say, the columnar numeric output file it created will cause the source code to lose its formatting and become one long line of codes, tab stops and special characters.

1. The easiest solution is to try reversing the roles - insert File B into File A instead of File A into File B. In the above example, if you insert the output into the source code, the formatting remains correct. You may need to experiment a bit to get this right.
2. Another possibility is to try to clean up the results using some of the formatting features (Format menu), such as Reformat Paragraph and Convert CR/LF's to Wrap. This approach will probably require quite a bit of work.

UltraEdit Instructions
Contents

### Macros

Macros provide a means of automating small, specialized procedures that you may frequently perform. For example, macros could automate a search-and-replace operation used often.

Macros in UltraEdit work much like macros in Excel and many other applications. Rather than requiring you to program the functions and operations directly, the macro editor allows you to record the sequence of keystrokes and locators that are used to perform a task, and assign that sequence to a single keystroke combination (e.g., CTRL-SHIFT-F1). Whenever you want to do perform that operation, all you have to do is press the appropriate combination of keys.

Macros may

- invoke other macros
- automatically be loaded when UltraEdit starts
- be assigned to a Hot Key
- be run (played) once or multiple times.

To create a macro:

- Select the Macro pulldown menu.
- Choose Record.
- Specify the name of the macro, and the key combinations you will use to invoke it. Click OK.
- Perform the task(s) desired.
- Select the Macro pulldown menu and choose Stop Recording.

Now save your macro for future use:

- Choose Macro / Save All... . You will be prompted to enter a filename with a .MAC extension.
- If you want you macro to be available automatically when you open UltraEdit (as opposed to having to reload it manually), you will need to choose Macro / Set Autoload... and complete the popup menu.
  NOTE: Do not fill out the bottom two boxes unless you want you macro to execute when you open UltraEdit.

You can now invoke your macro simply by pressing the assigned key combination. It is often best to use a group of three keys, such as CTRL-SHIFT-F1, to distinguish your macro from system key combinations and to ensure against accidentally invoking a macro during normal text editing.

#### Hot key selection

If the selected Hot Key is already assigned to something else (e.g., an UltraEdit command), your new definition will override it. Always check your key combination choice against the list of UltraEdit Hot Keys by selecting Help / Index / Keyboard Commands.

UltraEdit Instructions
Contents

### Column Mode

UltraEdit can be thought of as existing in two modes: line mode and column mode. When performing deletions, jumps, searches, replacements, etc., you must tell UltraEdit in which mode to conduct these operations. The default is line mode. To toggle column mode, select Column / Column Mode from the pulldown menu. If you return to this menu, you will see that the options that were previously grayed out are now available.

In column mode you can:

- Insert/fill columns: Allows you to insert a text or numeric string at a user-specified column, starting at a user-specified line.
- Delete columns
- Cut columns
- Insert numbers: Generates line numbers in the actual document instead of just the editor, but may have other uses.
- Perform searches and replacements on selected columns:
  NOTE: UltraEdit cannot currently perform prompted search and replace in column mode.

> WARNING: Column mode affects several aspects of UltraEdit's operation, even disabling certain ones (e.g., Edit / Delete Line). It is usually wise to toggle column mode off when you are finished working in it. To do this, select Column / Column Mode.

UltraEdit Instructions
Contents

### Viewing More than One File at a Time

UltraEdit features a number of ways to open multiple windows of data at once. They are all available under the Window pulldown menu.

Tabs (default) | Tile Horizontal | Tile Vertical | Cascade

To return to the default display, click on the

maximize button

at the top right corner of the window you want maximized.

UltraEdit Instructions
Contents

### Format Conversions

In going from one platform to another, it is sometimes necessary to convert the formatting of your data file, or to be able to view your documents in hexadecimal for debugging. It is also helpful to be able to convert line feeds (LF) and carriage returns (CR) to line wrapping and vice-versa and to be able to trim trailing spaces. UltraEdit supports all of these features.

####

Supported conversions (two-way):

- UNIX <==> DOS
- MAC <==> DOS
- OEM <==> ANSI
- ASCII <==> EBCDIC

####

How to . . .

> Perform conversions

> > To perform any of these conversions pulldown, choose the File / Conversions pulldown menu item. The OEM to ANSI conversion is mostly used for converting DOS format to Windows format. EBCDIC is the file format for IBM mainframes.

> Hex edit

> > Enter hex edit mode by choosing Edit / Hex Edit from the pulldown menu, or press CTRL-H.

> Convert line feeds & carriage returns to wrapping

> > Choose Convert CR/LF's to Wrap or Convert Wrap to CR/LF's (whichever is appropriate) from the Format pulldown menu.

> Trim trailing spaces

> > Choose Format / Trim Trailing Spaces from the pulldown menu.

UltraEdit Instructions
Contents

## Special Features for Programmers

### Keyword Color Coding

UltraEdit permits you to define a series of words and characters that will be used to color-code the contents of a file. Assigning special colors to certain words helps discern the organization of the file contents. This is especially useful to programmers writing and editing code.

UltraEdit's color coding is based on instructions located in a file called `WORDFILE.TXT`. This file is comprised of six "slots", each one containing instructions for one type of file; each slot may be replaced with another at any time. The instructions in the WORDFILE slots tell UltraEdit

- how to recognize what kind of file has been loaded (typically based on file name extension)
- which words in that file to highlight.

Many programming languages are based on sets of words that share the same basic function; for example, four common sets are statements, strings, declarations, and comments. While UltraEdit does not support functional highlighting per se, it is possible to achieve the equivalent effect by creating a WORDFILE class that represents all of the instances of that function. In other words, you cannot tell UltraEdit to color all of the declarations blue, but you can give it every example of a declaration statement in your programming language and tell it to color-code those words.

Each WORDFILE set may be configured to display a different color for each of the following groups of words:

- Five groups (keyword categories) of different recognized words
- Words that appear in a comment line (denoted by certain characters)
- Normal text (words that are not recognized).

To recapitulate: there is one WORDFILE, which supports six formatting slots; for example, slot 1 could be used for C++ syntax, slot 2 for Fortran, etc. Each slot, supports five keyword categories to be highlighted, plus comments and normal text.

The file extension determines which slot in the WORDFILE will be used by UltraEdit in deciding which keywords to highlight in the open file. Below is an example of the format code from a slot that recognizes the file extensions `C`, `CPP`, `H`, `HPP`, and `AWK` to highlight C and C++ code. In the following example, `/C1` marks the beginning of the first keyword group, `/C2` marks the beginning of the second, etc. Each group is assigned a different color.

`/L1"C/C++" Line Comment = // Block Comment On = /* Block Comment Off = */ String Chars = "' File Extensions = C CPP H HPP AWK /Delimiters = ~!@%^&*()-+=|\/{}[]:;"'<> , .?
/C1
auto
break
case char const continue
...
__asm __fastcall __self __segment __based __segname __fortran __cdecl __huge __far __saveregs __export __pascal __near __loadds __interrupt __inline #define #error #include #elif #if #line #else #ifdef #pragma #endif #ifndef #undef
/C2
class
...
virtual
__multiple_inheritance __single_inheritance __virtual_inheritance`

Based on these instructions, UltraEdit produces the following color-coding of a C++ file:

> (Click thumbnail to view full image)

You may define their own wordfiles, or download sample wordfiles from the UltraEdit Home Page. Once you have your wordfile, you must tell UltraEdit where to look for it and what colors to use.

1. For safety, begin by making a backup of the system WORDFILE (`WORDFILE.TXT`).
2. Append your WORDFILE file's contents to the system WORDFILE file. The first line of your file should have a number indicating which slot in the system WORDFILE it is intended to occupy. For example:

   `/L5 Nocase FORTRAN_LANG Line Comment = ! Nocase File Extensions = FOR F90 F FTN`

   indicates that Fortran 77 and Fortran 90 occupies your fifth (`L5`) language slot. Further, this indicates that this slot will be used for files whose filenames end in `.FOR`, `.F90`, `.F`, and `.FTN`. Note that languages added in this way should be placed in slot five or six.
3. From the pulldown menu, select Advanced / Configuration... You will see a number of option categories, each with its own tab. Click on the Syntax Highlighting tab. You should see a menu that looks like this:

   (click thumbnail to view full image)

   If not already shown in the window, enter the path for the wordfile you are using. The Color Selection window at the top of the menu lets you select which colors will be used to display each of the word groups for your language. To change the defaults, select which language slot you are using and click on the color you wish to change. This will bring up the color menu. Select the appropriate color and click OK. The new color should now appear in the appropriate slot. Continue until you are satisfied with your selections.

You can now open a file using one of the language slots and have the appropriate color coding take place automatically. It may be necessary to restart UltraEdit for these changes to take effect. Be sure to save the changes when prompted to do so.

NOTE: `HTML`, `Fortran` and `LaTeX/TeX` are special cases which may not conform completely to this template. See the UltraEdit Home Page for further details.

UltraEdit Instructions
Contents

### Spawning DOS Commands

UltraEdit features the ability to execute DOS commands and capture their output automatically. This has a variety of applications, but it primarily useful for compiling programs. To spawn a DOS command,

- Choose DOS Command from the Advanced pulldown menu, or press F9
- At the popup window, type the command line and working directory
- Click OK

UltraEdit will automatically capture the output written to your screen and store it in a file called Command Output. An example of this is shown below:

> (Click thumbnail to view full image)

UltraEdit also allows you to repeat the last DOS command issued. This is useful for debugging code when the DOS command runs a compiler. To repeat the last DOS command, simply choose Last DOS Command from the Advanced menu, or press CTRL-F9.

Command line:

A dialog box is presented in the DOS Command box that allows the command line to be specified. This should be the full path of the file to be executed, unless

- it is a system command (such as `DIR`)
- it is in the Windows directory
- it is in the Windows / System directory

Wildcards and Sequences

The DOS command can be constructed so that the active file's name is passed to the program to be executed. For example:

> You set up a command to run a compiler and you want to invoke the compiler with the file you are currently editing. If you change files you want the compiler to be invoked with the new file. For example, suppose the compiler is `C:\comp\compiler.`

> Specify the following command in the dialog box:

> > `C:\comp\compiler %F`

> When the command is executed, the `%F` will be replaced by the full directory path, filename and extension of the active window, The file will be saved before the command is executed.

> The following commands may be used to pass a portion of the fully qualified filename:

> `
> - %P Path only ("C:\project\test\")
> - %N File_Name only ("test")
> - %E Extension only (".c")
> `

> `%P%N%E` is equal to `%F` which is `"C:\project\test\test.c"` in the example above.

NOTE - If the `%f, %p, %n, or %e` are typed in lower case the file names are passed as long file names and should be put in quotation marks, (e.g., `"%f"` or `"%p%n"` ) . If the `%F, %P, %N, %E` are typed in upper case the file name and path will be converted and passed as the "8.3" short filename specification for compatibility with DOS programs.

Working directory:

A working directory is only supported by UltraEdit-32. The working directory should be the full path of the working directory, or left blank if not required.

####

Additional notes:

Output from a DOS program is sometimes saved in a temporary location by the operating system. Therefore spawning a DOS command from UltraEdit may not work correctly with a program that requires interaction while it is executing. For example, prompts may not appear on the screen at the correct time and you may wonder why there is no activity. The output will always be captured. Thus, if the program generates no screen output, then the captured output may indeed be empty (and UltraEdit will therefore show an empty window).

UltraEdit Instructions
Contents

## Common Problems

1. I'm running a DOS command from UltraEdit, and all I get back from captured output is a blank screen.

UltraEdit always captures the output to the screen. Thus, if the Command Output file is empty, then there is a strong likelihood that the output may itself be empty, or that the output was written to a device other than the screen.

2. How can I do a multiple-field sort, as in Excel?

You can't. UltraEdit does not support multiple-field sorting.

3. I'm trying to import the contents of one file into another, but the formatting gets messed up.

Try reversing the order of the import - insert File B into File A instead of File A into File B. For example, if you were to insert the output of a program into the file containing the program source code, you would find that the format remains intact; if you were to try it the other way around, however, the file may become incorrectly formatted. It may be necessary to experiment a bit to get this right. For more information on this topic, click here.

Contents

## Other Resources

There are currently no manuals or other such materials for UltraEdit. However, UltraEdit's on-line help and the web-based question-and-answer file contain many effective suggestions. Registered users who find these inadequate should contact IDM Software directly.

Please send a copy of the question and the response to RDMS so that we may include it in our help pages.

Contents

## If You Still Need Help

If you need help quickly, call the Help Center at 831-6000 between 8 a.m. and 5 p.m., Monday through Friday. Or, you can submit a question through e-mail.

Contents

Last modified: October 17, 1997
This page maintained by N. S. Gerbis.
Copyright © University of Delaware 1997.