Power Tips Archives - UltraEdit https://www.ultraedit.com/blog/category/power-tips/ UltraEdit Fri, 11 Oct 2024 18:59:11 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.2 https://www.ultraedit.com/wp-content/uploads/2023/01/UE_logo_icon_white-1-1.png Power Tips Archives - UltraEdit https://www.ultraedit.com/blog/category/power-tips/ 32 32 Master UltraEdit’s Flexible Search Functions https://www.ultraedit.com/blog/master-ultraedits-flexible-search-functions/ https://www.ultraedit.com/blog/master-ultraedits-flexible-search-functions/#respond Thu, 10 Oct 2024 17:39:27 +0000 https://www.ultraedit.com/?p=32464 Introduction Every editor has a more or less good search function to search for text, numbers and characters. UltraEdit has integrated so many flexible options for this functionality that it will warrant and extensive explanation; but it is a worthwhile investment as it provides the user with extremely powerful tools for his daily usage. We […]

The post Master UltraEdit’s Flexible Search Functions appeared first on UltraEdit.

]]>
Introduction

Every editor has a more or less good search function to search for text, numbers and characters. UltraEdit has integrated so many flexible options for this functionality that it will warrant and extensive explanation; but it is a worthwhile investment as it provides the user with extremely powerful tools for his daily usage. We would like to describe the functionality in the following text and use various practical examples to show why the search functions of UltraEdit are considered so outstanding by many users.

Quick Find

Quick Find is the function that is intended for quick lookups and can be opened using the key combination Ctrl + F. This opens a small box in the top right-hand corner, which is helpful if the user wants to search quickly without using the large/normal search function.

Figure 1: Quick Find fly-out box

It is particularly practical that UltraEdit enters the word at the position of the cursor in the search field by default.

Note: The key combination Ctrl + F can be changed in the UltraEdit settings. To do this, go to the Key mapping category in the UltraEdit settings and select Quick find in the list. The existing key combinations are displayed in the right area and a new combination can be defined directly below.

Find and Replace dialog

The actual search is handled in UltraEdit via the Find and Replace dialog, which is displayed with 4 tabs at the top: Find, Replace, Find in Files and Replace in Files.

This dialog can be launched via the menu, the ribbon icons and various key shortcuts, whereby the desired tab is preselected depending on the key combination:

Command Shortcut Function
Find Alt + F3 Comprehensive search for strings
Replace Ctrl + R Replaces search results in Find
Find in files Ctrl + Shift + F Find functionality in a chosen files or directory
Replace in files Ctrl + Shift + R Replace functionality in a chosen files or directory

 

The figure below shows the Find and Replace dialog in its standard display, whereby the word located at the cursor is automatically transferred to the search field:

Figure 2: Find and replace dialog

The search parameters are as extensive as the user wants them to be. In the default setting, the dialog shows basic functions. Use the gear symbol at the bottom to open the advanced search options:

Figure 3: Find and replace dialog with its advanced options

Two further keyboard shortcuts are required to navigate through the search results:

  • F3 or Shift + F3: Find next result
  • Ctrl + F3: Find previous result

The In section defines the used search parameters, which includes current/all open files or the selected text. In addition to the options for searching for whole words, case sensitivity, and counting the number of matches found, there are many practical power functions that I have appreciated for many years and have fortunately found again in UltraEdit. This also has to do with editing source code, for example in C++ or in Delphi as well as in other languages. 

One feature I’ve used a lot in the past is the highlighting of all matches found. When I write source code, as in the following screenshot in Object Pascal/Delphi, and enable the option Highlight all items found, all hits found are highlighted in color, which gives me a better overview of where further adjustments may be necessary:

ultraedit find query settings options

Figure 4: Find option for highlighting all items found

I also find the option List lines containing string extremely useful, whereby a new result dialog with the string matches is displayed after the search. By double-clicking on a line, UltraEdit jumps directly to the respective line. This option is very similar to the Microsoft Word search function, for example, whose results navigation I really appreciate and I am all the more pleased that UltraEdit also makes this possible.

Regular expressions are also an important major topic in all kinds of searches. UltraEdit also supports them extensively and they will be described in more detail later in this text.

To conclude the Find function, let’s talk about the 3 button symbols above:

  • Circle with clock inside: shows a history of all previous search terms for possible reuse
  • Yellow star: allows to define favorites that can be loaded for quick reuse. The context menu contains the menu items Add to favorites, Edit favorites and Favorites – the last item contains the saved favorites in a selectable list
  • Green star and dot: can be selected as soon as the option Regular expressions is enabled and opens a list of regular expression options appropriate to the selected regular expression engine

Replace

If we move from the classic find function of text/code to the replace function, the basic functionality is retained, and in a simple sense is supplemented by a second string that replaces the search string. UltraEdit offers in the Replace tab the same basic functionality and extends it with the function buttons:

  • Replace: replaces the string from the “Find what” section with the string from the “Replace with” section (keeps the Find and Replace dialog permanently open)
  • Replace once: replaces the searched string from the “Find what” section with the string from the “Replace with” section once (closes the Find and Replace dialog afterwards)
  • Replace all: replaces all occurrences of the searched string from the “Find what” section with the string from the “Replace with” section (keeps the Find and Replace dialog permanently open)

Figure 5: Find and replace dialog with the Replace function opened

You will also notice that a small black icon button with two arrows has been added to the “Replace with” section, which conveniently swaps the two strings of the “Find what” and “Replace with” sections. It has happened to me many times that I wanted to undo a replaced string, for which the undo function can of course also be used. Depending on the text/code, however, it may make sense to simply swap the two sections and then replace them again.

Also relevant for the replace function and always very helpful for me is the option Preserve case. This power function causes UltraEdit to match the case of the replace string with the case of the found string with the condition of multiple rules:

  • if the word found is all lowercase, the replacement word will be all lowercase
  • if the word found is all UPPERCASE, the replacement word will be all UPPERCASE
  • if the word found is MixedCase, the replacement word will match the casing of the replacement word

We will illustrate this function with an example from the Delphi world. A corresponding click event is created for a button on a form and the procedure Button1Click is called as soon as the button is clicked. If we now enter “Button1Click” in the Find section and “ButtonActionClick” in the replace section, the following for all occurrences happens:

  • “button1click” will be replaced with ”buttonactionclick”
  • “BUTTON1CLICK“ will be replaced with ”BUTTONACTIONCLICK”
  • ”Button1Click“ will be replaced with ”ButtonActionClick”

Find/Replace in Files

Now that we have talked in detail about finding and replacing in the currently open file/document, we come to the supreme discipline, namely finding and replacing in complete files and directories.

This functionality is already known from various IDEs (Integrated Development Environments), such as Microsoft Visual Studio and Embarcadero RAD Studio, where it is used to search projects or entire project groups across multiple files, folders, and even drives.

UltraEdit’s professionalism is now emphasized by providing this powerful feature of IDEs in a text editor, and we will take a closer look at it below:

Figure 6: Find and replace dialog with the Find in Files function opened

What is immediately noticeable here is the adjusted search focus in the In section, where the default setting is the “Files listed” option – this searches the files located in the two edit fields below, “In files/types” and “Directory”. While the directory field can accept a directory either in text form, via the “Use active file path” button or via the browse button next to it, the upper field “In files/types” can be used to specify either individual files or wildcards. Multiple entries are separated by a semicolon and 3 typical examples might look like this:

  • *.pas;*.cpp
  • Testfile.txt;*.cpp;*.h
  • *.pas;TestForm.frm;*.dfm

In these examples, wildcards and named filenames are mixed, which UltraEdit can easily handle when the semicolon is used as a separator.

Further In section options are available for open files, favorite files (Application Menu -> Favorite Files) and project files – the latter searches all files within a currently open project. These three options ignore the edit fields “In files/types” and “Directory”, as these are only used with the “Files listed” option.

The Find button closes the Find and Replace dialog, the search is then performed and all results are displayed in the Output Window below. The respective files can be opened in the Output Window by double-clicking on the line with the file name. Anyone who is familiar with the Output Window will know that there are many more options available in a context menu via the right mouse button. These include collapsing/expanding the entire window content and copying the content to the clipboard.

Figure 7: Output Window with the results of the Find in Files search function

What is worth mentioning at this point, apart from the regular expressions (which we will come to at the end of this blog), are the interactive results.

When the Interactive results option is enabled, the Find in Files search will open a new Interactive results document. In this window all the Find in Files results are returned, but these results are immediately editable and the user doesn’t have to take intermediate steps to open matched files to edit the string that was searched for. This is effectively a window into the relevant portions of each matched file and the users may edit results individually as desired.

Figure 8: Interactive results window from the Find in Files function

If preferred and once the Interactive results document is opened, the user may switch to the Replace tab in the Find and Replace dialog. When focus is on the Interactive results document, the All open files option in the Replace dialog is dynamically changed to All results. If this option is selected, the user can use the replace operation interactively by pressing the Replace button, or uses Replace all to replace all matched strings in all files listed in the Interactive results document. When All results is selected in the Replace dialog, no other open files will be affected by the Replace all operation.

When direct editing of the results (either by typing or replace operations) are done, the user may close the Interactive results document. When the document is closed, a prompt appears asking whether the changes should be saved – changes would then be saved for all modified documents listed in the Interactive results document. This additional intermediate layer provides a clear way of keeping track of things, especially if there are many files that need to be changed.

The fourth major search function is Replace in Files, and here the Replace function is used in connection with listed files (names & wildcards as well as directories), favorite files or project files.

Figure 9: Find and replace dialog with the Replace in Files function opened

In the replace options, the user can include subdirectories, ignore certain hidden directories or file names/extensions and use the two options List changed files and Open matching files.

With the first option Open matching files is enabled, any files matching the specified parameters will be opened when the search completes. The second option List changed files instructs UltraEdit to list all the files that were modified in the Output Window. If enabled, each file change will be listed in the Output Window followed by the number of occurrences found and changed.

Regular expressions

Regular expressions have been widely used for many years and once you have understood the principle, you will never want to miss them again. In UltraEdit, the option to activate regular expressions is available in all 4 tabs of the Find and Replace dialog. Once activated, you can choose from 3 different expression types:

  • Perl: UltraEdit uses Perl style regular expressions based on the Boost C++ Libraries
  • UltraEdit: UltraEdit uses its own style regular expressions
  • Unix: UltraEdit uses Unix style regular expressions.

Regular expressions are search strings where certain characters (symbols) have a special meaning. The following symbols and associated functions exist in the original UltraEdit syntax:

Symbol Function
% Matches the start of line – this indicates the search string must be at the beginning of a line but does not include any line terminator characters in the resulting string selected
$ Matches the end of line – this indicates the search string must be at the end of line but does not include any line terminator characters in the resulting string selected
? Matches any single character except newline
* Matches any number of occurrences of any character except newline
+ Matches one or more of the preceding single character/character sets, where at least one occurrence of the character must be found
++ Matches the preceding single character/character set zero or more times
^b Matches a page break
^p Matches a newline (CR/LF) (paragraph) (DOS files)
^r Matches a newline (CR Only) (paragraph) (MAC files)
^n Matches a newline (LF Only) (paragraph) (UNIX files)
^t Matches a tab character
[xyz] Matches any characters between brackets (a character set)
[~xyz] Matches any characters not between brackets including newline characters (a negative character set)
^{A^}^{B^} Matches expression A or B
^ Overrides the following regular expression character
^(…^) Brackets or tags an expression to use in the replace command. A regular expression may have up to 9 tagged expressions, numbered according to their order in the regular expression.   

The corresponding replacement expression is ^x, for x in the range 1-9
Example:
If ^(h*o^) ^(f*s^) matches “hello folks”, ^2 ^1 would replace it with “folks hello”.

These symbols and associated functions result in many examples, some of which are described below to give you an idea of how they are used:

m?n matches “man”, “men”, “min” but not “moon”

t*t matches “test”, “tonight” and “tea time” (the “tea t” portion) but not “tea
time” (newline between “tea ” and “time”).

Te+st matches “test”, “teest”, “teeeest” etc. but does not match “tst”

[aeiou] matches every lowercase vowel

[,.?] matches a literal “,”, “.” or “?”

[0-9a-z] matches any digit, or lowercase letter

[~0-9] matches any character except a digit (~ means not the following)

 

The user can search for an expression A or B as follows:

“^{John^}^{Tom^}”

This will search for an occurrence of John or Tom – there should be nothing between the two expressions.

 

 The user can combine A or B and C or D in the same search as follows:

“^{John^}^{Tom^} ^{Smith^}^{Jones^}”

This will search for John or Tom followed by Smith or Jones.

 

Summary

UltraEdit offers flexible search and replace functions that work either for individual files/documents or complete directory structures. Countless options allow you to fine-tune the parameters and leave almost nothing to be desired. UltraEdit thus takes the step forward of providing much more powerful functions than many users are used from a text editor. As a result of these options, productivity is increased and search and replace is as powerful as the user works with this functionality – this blog provides the necessary know-how for this.

If you’re looking for a versatile text editor with powerful find and replace functionality, you can rely on UltraEdit. Download it now and try it for 30 days for free.

Try UltraEdit

 

The post Master UltraEdit’s Flexible Search Functions appeared first on UltraEdit.

]]>
https://www.ultraedit.com/blog/master-ultraedits-flexible-search-functions/feed/ 0
Practical use of UltraEdit’s powerful Column Mode https://www.ultraedit.com/blog/practical-use-of-ultraedits-powerful-column-mode/ https://www.ultraedit.com/blog/practical-use-of-ultraedits-powerful-column-mode/#respond Fri, 04 Oct 2024 17:41:39 +0000 https://www.ultraedit.com/?p=32277 What is column mode? Column Mode is an often-unknown feature of UltraEdit for many users, and experience has shown that those who have become familiar with it no longer want to go without it. This powerful feature changes the way in which UltraEdit selects and edits text. Normally this is done horizontally from character to […]

The post Practical use of UltraEdit’s powerful Column Mode appeared first on UltraEdit.

]]>
What is column mode?

Column Mode is an often-unknown feature of UltraEdit for many users, and experience has shown that those who have become familiar with it no longer want to go without it.

This powerful feature changes the way in which UltraEdit selects and edits text. Normally this is done horizontally from character to character, and Column Mode changes this mechanism to vertical processing.

This mode is activated program-wide via the keyboard shortcut Alt + C and can be activated simultaneously via Edit -> Column / block (Ribbon mode), Edit -> Column mode (Contemporary menu mode) or Column -> Column mode (Traditional menu mode):

For further understanding, we will use a simple example with a text file consisting of 3 columns and 10 lines. Once activated, UltraEdit will highlight the text based on the column position of the first character the user selects to the column of the last character he selects. Text selected in column mode does not automatically include all text between the start and end position, but does include all text in the columns between the first and last character which is selected.

Assuming we would like to insert text before the second column, the position in the column and for the desired rows is marked so that we find the marker seen in the following first figure. This simple marker does not select a character or word, but a simple vertical position. By entering new text, e.g. the word “My “ this is now done across all selected lines (see the following second figure):

 

 

 

 

 

UltraEdit allows the user to specify the font to be used in Column Mode separately. This font is selected via View -> Fonts -> Set hex / column font (Ribbon mode and Contemporary menu mode) or View -> Set hex / column font (Traditional menu mode).

Pro tip: if fast editing without prior separate activation of the Column Mode is important, the Quick Column Mode is a good option. The same column selection can also be used via Alt + Click-n-drag, which automatically activates Column Mode. Column mode is then deactivated as soon as the cursor is repositioned.

Basically, there are 3 functions for editing columns, described in more detail below. The Insert / fill columns function can be used to enter text that is inserted into a special column. If several rows are selected, the text is entered in these selected rows. If no lines are selected, text is entered for all lines in the file. The dialog Insert/Fill Columns appears for this, in which the text is entered. The lower option is called Do not insert / fill on empty last line and prevents this text from being inserted in the last line of the file if this line is empty.

The further options Cut columns and Delete columns open a separate dialog in which the number of columns to cut/delete from every line staring at the current line and the current column can be specified (0 means to cut/delete columns based on highlighted text).

By using the justify options for left, center and right the user can justify a selected column of data, with the boundaries of the selection acting as the margins. Left-justifying a column of data will justify the data against the left of your selection, while right-justifying will do the opposite. Center-justifying the column of data will center the data within the selection.

As soon as any kind of line numbering is required, the Insert Number function is quite useful, which opens the dialog of the same name. Various options can be defined in this dialog:

 

  • First number: describes the first starting number for the
    counting
  • Increment: defines the steps in which the number is to be
    increased
  • Leading zeros: determines whether shorter numbers are
    padded with leading zeros to match the longest
    number (such as 001 to 100)
  • Do not insert / fill on empty last line: prevents the
    numbering in the last line if it is empty
  • Format: allows a distinction between decimal or
    hexadecimal notation.

 

If we use our original Column Mode example from the beginning and want to insert a number before each row, we select rows 1 to 10 in the first column, open the Insert Numbers dialog and press Insert at the bottom. We could also subsequently insert a space after the rows or a dot, depending on the requirements:

Please note: In our Column Mode example, we indeed have an 11th empty line, so it would make sense to enable the option Do not insert / fill on empty last line inside the Insert Numbers dialog.

If we use our original Column Mode example from the beginning and want to insert a number before each row, we select rows 1 to 10 in the first column, open the Insert Numbers dialog and press Insert at the bottom. We could also subsequently insert a space after the rows or a dot, depending on the requirements:

Please note: In our Column Mode example, we indeed have an 11th empty line, so it would make sense to enable the option Do not insert / fill on empty last line inside the Insert Numbers dialog.

The Sum function can be used to convert selected text areas into digits and add them up to a total. To do this, the user can select the area in Column mode, then select the Sum selection function and the Sum Selected Text dialog appears:

  • Ignore character in number: because some number formats contain non-digits characters, such as commas, dots or dashes, these characters can be ignored – leaving only the pure digits for the sum
  • Use locale: uses the Windows locale for the thousand separator, e.g. “,” or “.”
  • Total: contains the final result of the sum function
  • Copy to Clipboard: copies the sum to the clipboard
  • Help: opens the UltraEdit Online help system.

In our example above, we have selected the numbers added via the Insert Number function at the beginning of the line, and these are the line numbers 01 to 10. The sum of these line numbers is then 55, as calculated correctly by UltraEdit.

Another great strength of Column Mode is the handling of CSV files. These text files, known as Comma-Separated Values, are often used for lists, whereby several columns are separated from each other by a separator character (often a semicolon). Many spreadsheet programs allow tables to be saved and exported in this format. However, editing these files where column manipulation is required can be difficult because the column widths vary and do not have a fixed size. UltraEdit therefore has two functions that convert a CSV file to a file with a fixed column width and the reverse process via a conversion to a CSV file.

The first function is called Convert to fixed-width and opens the dialog Convert to Fixed Columns:

In this dialogue, the user can define the properties before UltraEdit analyzes the file content with the Scan button and finally converts it with the Convert button:

  • Scan first line only (vs. complete file): instructs UltraEdit to search just the first line for the field widths
  • Keep delimiter with fixed columns: means that when converting to fixed width columns the delimiter character for the fields will not be removed. If this option is disabled, the conversion process will remove the delimiter between fields
  • Ignore separator in quotes (‘): if enabled, separator characters which are enclosed in single quotes will not be taken into account when scanning to determine column spacing for alignment
  • Ignore separator in double quotes (“): this option is identical to the previous option, except that double quotes are taken into account instead of single quotes
  • Separator character (^t for tab): defines the delimiter character between fields (for the TAB character “^t” should be used). In all other cases, a single character should be entered and UltraEdit uses this character to determine the field boundaries
  • Field widths (separated by commas ‘, ‘): represents a list of comma-separated field widths used for the conversion process. If there are more fields than entries, the last entry will be used as the field width for the remaining fields, which allows the user to set a single entry, if all fields are required to be the same width. Please note, that this field must not be left empty when the conversion to fixed columns is executed. It may be populated automatically by pressing the Scan button after specifying the conversion options, or the user may manually specify field widths if desired
  • Scan: UltraEdit scans the file (or first line) and determines the maximum field widths for each field. This will determine the maximum width required for each field and place the results (comma separated) in the Field widths edit field.
  • Convert: performs the conversion from character delimited text to fixed column according to the defined settings – the complete file will be converted.

The opposite can be performed with the Convert fixed-width to CSV function, which opens the Convert to “Characters Delimited” text dialog:

  • Separator character (^t for tab): defines the delimiter character between fields (for the TAB character “^t” should be used). In all other cases, a single character should be entered and UltraEdit uses this character to determine the field boundaries
  • Field widths (separated by commas ‘, ‘): represents a list of comma-separated field widths used for the conversion process. If there are more fields than entries, the last entry will be used as the field width for the remaining fields, which allows the user to set a single entry, if all fields are required to be the same width
  • Convert: performs the conversion from fixed column to character delimited text according to the defined settings – the complete file will be converted.

Configuration of Column Mode

The performance of a function essentially depends on its flexibility and configurability, and here UltraEdit offers fine-grained settings. These can be opened either via Advanced -> Settings (Ribbon mode), via Advanced -> Configuration (Traditional menu mode) or via Advanced -> Settings (Contemporary menu mode). All three options open the Configuration dialog, in which all settings are contained in a central location. Within this dialog, the user needs to navigate to the category Editor -> Column mode to open the options for Column Mode:

  • Overstrike: handles the overstrike in Column mode and under which circumstances the overstrike is prevented:
    • No overstrike of unselected columns: should be selected, if the user never wants overstrike mode to be used with column operations
    • Overstrike if in overstrike mode: means that the column operations operate either in insert mode (as default) or overstrike/overpaste mode based on the insert/overstrike keyboard setting. This is toggled by the Insert Key and shows up on the UltraEdit status bar. If in overstrike mode, cut/delete operations will remove the contents but leave spaces so that column data is not shifted. Paste operations will paste over the current position data and not shift columns either
    • Always overstrike unselected columns: should be selected, if overstrike mode is required permanently for column mode. 
  • Automatically populate sort fields when in column mode: controls the behavior of selected text in column mode. If this option is enabled, in that case the column values for the current selection will be used to automatically populate sort fields in the Advanced Sort/Option dialog when the Sort function is invoked
  • Paste into all selected columns when clipboard contains less than 1 line: by using this option and when a multi-line selection exists in column mode, a single string copied to the clipboard will paste to all selected lines. If this option is disabled, the column mode paste would only apply to the first selected line.

 

Two practical examples for the Column Mode:

Finally, we would like to describe two practical scenarios that can be used to understand the performance of the Column Mode. Even if the following two scenarios appear relatively compact, these options should always be considered on a larger scale. A realistic question would be: how much time and effort would I save if I had to edit not just a 10-line log file, but a 1,000,000-line log file?

Scenario 1:

For this first scenario, we have Delphi source code, and as can be seen in the following upper left figure, the procedure Button1Click is shown, which describes those activities as soon as the button with the name Button1 is pressed. We now extend the source code with a so-called if-then query, which describes a coherent code action with a subsequent begin, that is terminated again with end; (in the following upper right figure). This begin-end block is usually indented two positions to the right, which favors a more structured syntax. We therefore activate the UltraEdit column mode and first mark the lines to be indented at the respective position (please see the following lower left figure). If we now insert a space twice with this positioning, the entire selected block is indented to the right and we have achieved our result (please see the following lower right figure):

 

Pro tip: The same method can also be used to comment out a code block of any size by entering the two characters // instead of 2 spaces. In Object Pascal and C++, this means that the respective line is commented out, which is then applied to the entire selected block in column mode.

Scenario 2:

In this second scenario, we use a log file, as they exist in many IT sectors; UltraEdit is known for processing extremely large files. Our log file consists of 4 columns and 11 lines, of which the first line is the header. The columns are named Number, Date, Owner and Value:

First, we want to use the Sum selection function and therefore activate the Column Mode, select the Value column in lines 2-11 (without the header row), and select Sum selection (e.g. from the Edit -> Column / block tab in Ribbon mode). The Sum Selected Text dialog box then opens and the sum is displayed correctly in the Total field with 123450:

In the next step, we would like to replace the slashes in the date column with hyphens. A “01/09/2024” should therefore become a “01-09-2024”. To do this, we select the first slash column in column 2 within rows 2-11 (without the header row) as seen in the following top figure and activate overstrike mode by entering a hyphen. This means that the slash in all selected rows is overwritten by a hyphen. We repeat the same process in the second position of the slash so that we achieve a result as shown in the following bottom figure:

Summary:

UltraEdit’s Column Mode is a powerful feature for editing text and source code in a new way than was previously possible. Combined with the flexibility and processing of extremely large files, even gigabyte-sized log files can be edited vertically.

Additional functions allow the handling of new/existing columns, the change of alignment (left/center/right), the flexible insertion of numbers, a sum function as well as the conversion to and from CSV files with variable column width to a fixed column width and vice versa.

Column mode can be further configured in the UltraEdit settings, and the experience with customers has shown that anyone who has got to know this function appreciates it and no longer wants to work without it. With this in mind, have fun boosting your productivity!

Learn more about column mode:

The post Practical use of UltraEdit’s powerful Column Mode appeared first on UltraEdit.

]]>
https://www.ultraedit.com/blog/practical-use-of-ultraedits-powerful-column-mode/feed/ 0
The Value of Hex Editors: Where they’re used https://www.ultraedit.com/blog/the-value-of-hex-editors-where-theyre-used/ https://www.ultraedit.com/blog/the-value-of-hex-editors-where-theyre-used/#respond Tue, 26 Mar 2024 16:45:16 +0000 https://www.ultraedit.com/?p=29095 For some professionals and developers, hex editors are crucial tools to have—especially in the digital era. It allows them to modify and have full control of every byte value within a binary file. And apart from that, they can be useful for plain text files as well as non-printable characters (e.g. when opening a config […]

The post The Value of Hex Editors: Where they’re used appeared first on UltraEdit.

]]>
For some professionals and developers, hex editors are crucial tools to have—especially in the digital era. It allows them to modify and have full control of every byte value within a binary file. And apart from that, they can be useful for plain text files as well as non-printable characters (e.g. when opening a config or source file with a character with no representation).

Hexadecimal notation, commonly referred to as hex, serves as a cornerstone of modern technology. It is a numbering system with a base of 16 that uses 16 symbols to represent values from 0 to 15. It includes the standard symbols 0-9 and the letters A-F (or a-f) to represent values from ten to fifteen. Its presence is evident in various industry systems, including binary file formats, memory, and network addresses.

Moreover, hex plays a crucial role in encoding ASCII characters, streamlining the transmission of text data. Hex editors serve as essential utilities, empowering users to navigate and modify binary data efficiently. 

In a nutshell, hex editors are indispensable for navigating the digital landscape, enabling precise control and manipulation of data formats.

What are Hex Editors?

Hex editors are extensively utilized by programmers, security professionals, system administrators, and other tech-related professionals to view and edit binary data written in a hexadecimal format. 

Although similar to text editors that edit plain text data, hex editors are tailored for working with binary data. This allows developers and users to edit individual bytes of data present in a file. 

What does a hex editor do?

Additionally, there are files that cannot be edited in a text editor. If you’ve ever tried opening a file without the corresponding program that can read it (e.g. a random .dat file), your system may automatically default to using a simple text reader to try and open it. This opens a garbage file that is illegible and unusable—unless you use a hex editor.

Why are Hex Editors Necessary?

Hex editors provide users  access to the raw bytes that make up a file. Most of us who use text editors see user-friendly interfaces and texts that we can understand. However, behind the scenes are strings of binary values that are represented by text humans can understand.

Peeking through these binary values can help both developers and users alike to do the following:

  • Troubleshoot and fix corrupted bytes of data

Corrupted data can stem from hardware malfunctions, software bugs, code tampering, and more. Its effect can be observed as data loss, crashes, or errors— affecting the productivity and utility of a system. 

Even the bytes of plain text files aren’t invulnerable against data corruption. Fortunately, hex editors offer users the ability to accurately locate and rectify corrupted bytes to their accurate values.

Note that the hex editor itself won’t tell you which byte(s) within the file is corrupted – you’ll need to know what to look for. But the hex editor provides a clear view into the bytes of the file so that you can easily do so, along with other tools like search/replace.

  • Finding and removing non-printable / out-of-range characters in plain text files

Non-printable or out-of-range characters may sometimes be in plain text files. Depending on the program or use case, they may need to be removed to ensure data integrity, functionality, and human readability. Hex editors can read non-printable characters that can interfere with operations like searching, sorting, or parsing text.

  • Data recovery

Being able to correct corrupted data, hex editors also allow users to recover lost data due to corrupted bytes. As mentioned previously this is achieved through inspecting and repairing binary data.

  • Easier debugging process

Through hex editors, developers can inspect the embedded strings that are in executable files to further understand their structure. If you have enough prior knowledge, you can make targeted changes, fixing errors, or applying updates to compiled executables without access to the original source code

  • Data modification and exploration

Hex editors are handy tools for exploring and tweaking file formats. By checking out how files are put together in binary, users can figure out how they work and adjust as needed. 

This could mean modifying game saves, modding games, adjusting settings in config files, or fixing up software files to make them work better.

Because you are editing specific bytes, you can alter certain executables with the proper know-how. Hex editors are commonly used to reverse engineer certain programs and executables because of how intricate it can be.

Limitations of hex editors

While extremely powerful and versatile, hex editors are not complete solutions. Editing singular files may not allow you the complete access you expect. For instance:

  • You can copy and modify data—but without the program to properly read the file, you cannot execute it.
  • You cannot bypass dependencies and third-party verification (digital certificates). In fact, altering even just a single byte in a digitally signed binary file will “break” the digital signature and introduce security issues if executed later.
  • Some applications rely on multiple files and programs to run. Editing one file does not automatically translate to a workable file.
  • You need some prior knowledge of when and where the relevant data starts. (How do you know where the “row data” starts and ends?)
  • It may be overwhelming editing files of significant sizes using a hex editor. You may miss fundamental editing features such as those in text editors.

Considerations when picking a hex editor

There are many hex editors in the market ranging from free open-source software to paid ones. However, there are many things that you would like to consider before committing to buying one. Here are some of them:

  1. Ease of use
  2. Ancillary editing tools
  3. Supported platforms
  4. Security
  5. Support and updates
  6. Credibility

Recommended Tools for Working with Binary Files

When working with hex editors, you would most likely be using data manipulation techniques and features found in text editors. That is why some developers use both text editors and binary file editors for their work.

However, it may be tedious to switch between a text and hex editor repeatedly. UltraEdit stands out as a 2-in1 text and hex editor with higher software security standards. UltraEdit combines both text and hex editors, removing the need to run two separate programs to edit textual and binary data. 

Renowned for being able to open and edit extremely large files, UltraEdit’s optimized performance allows it to effortlessly handle any project, ensuring swift editing without compromising efficiency. 

Security and privacy are also one of its strengths. It comes with many security features including data encryption support, password protection, and regular security updates—features that you appreciate if you regularly work with sensitive data and binary files. 

Compatible across multiple operating systems, UltraEdit ensures seamless integration into your workflow. It only requires one license for Windows, Mac, and Linux; allowing users to utilize the editor using up to three machines on any platform. 

Apart from being a text and hex editor, UltraEdit is a multi-purpose editor that includes a text editor, HTML editor, XML/JSON viewer, and a hex editor, empowering users to tailor the editor to their specific needs. 

With UltraEdit, you’ll experience a smooth, secure, and productive editing experience, making it the ideal choice for professionals and enthusiasts alike.

Try UltraEdit text editor with Hex mode.

The post The Value of Hex Editors: Where they’re used appeared first on UltraEdit.

]]>
https://www.ultraedit.com/blog/the-value-of-hex-editors-where-theyre-used/feed/ 0
Scripting 101: Using UltraEdit’s integrated scripting engine https://www.ultraedit.com/blog/scripting-101-using-ultraedits-integrated-scripting-engine/ https://www.ultraedit.com/blog/scripting-101-using-ultraedits-integrated-scripting-engine/#respond Mon, 29 May 2023 18:34:04 +0000 https://www.ultraedit.com/integrated-scripting-engine/ UltraEdit has a built-in scripting engine that allows users to execute instructions (ie. JavaScript) directly inside the editor. This allows users to enjoy the power and flexibility of the JavaScript language while using the UltraEdit or UEStudio Application Object/Document commands to interact with the editor or documents open in the editor.  Of course, this is […]

The post Scripting 101: Using UltraEdit’s integrated scripting engine appeared first on UltraEdit.

]]>
UltraEdit has a built-in scripting engine that allows users to execute instructions (ie. JavaScript) directly inside the editor. This allows users to enjoy the power and flexibility of the JavaScript language while using the UltraEdit or UEStudio Application Object/Document commands to interact with the editor or documents open in the editor. 

Of course, this is doable with a number of workarounds such as copying a selection, saving it as a file, opening that file as an active document, and then finally running the script you coded. But that’s one of the benefits of a seamless editor like UltraEdit—everything is accessible in one spot.

Writing scripts in UltraEdit

Using scripts will usually follow the following structure:

  • Step 1: Writing the script
    Start coding your script inside UltraEdit/UEStudio. As mentioned above, you may use the latest JavaScript features (most recently updated with UE 2023.0) and the UltraEdit/UEStudio Application Object commands and Document Object Commands.

    UE’s scripts allow a variety of variables such as user input, selected text in the editor, as well as all the regular functions available in JavaScript.

    If the task you are doing is more repetitive in nature and does not rely on complex variables, you may consider using macros instead.
  • Step 2: Add the Script
    Once you’ve saved the script you have just created, you will need to add it in the Scripting Scripts dialog. This also allows you to run the scripts again should you need to in the future.To save a script, click on the “Add” button to add the script to the list. You will need to browse to the location of the script. Try to add a description to make your library of scripts easier to use—your future self will thank you.|

    Once the script has been added, you can define a hotkey for a quick and easy execution of the script. Click Okay when you are done.

    Protip: If you have just written a script in a separate tab in UltraEdit, you can navigate to the temp folder so you no longer have to save the script as a file since—you will save it in UE’s script directory anyway.
  • Step 3: Execute the Script
    To execute the script, go to the Scripting menu and press the Run Script button. You can also choose which script to run among your saved scripts.

    If a script is executed successfully, you should see a success prompt in the output window. Take note! A script may execute successfully but with the unexpected output. Examine both your script and the corresponding output to ensure the proper outcome occurs.

Where to learn more about UE’s scripting

Power tips / Website

This page lists down some techniques with examples to help you automate your text-editing operations. There are a couple of tutorials and power tips available on the UltraEdit website. For example, there is a page that lists down most of the available scripting functions as well as a compilation of common scripting techniques that can be used to manipulate and process opened text files. There is also feature documentation on the UE Wiki.

User-to-user Forums
There is no better way to find possible use cases than to check in with your peers. If you find yourself discovering tasks that can greatly benefit from a scripted operation, there is a large chance that other users have encountered similar problems—it is likely you can find similar solutions too.

UltraEdit’s forums has a special section for sharing and requesting assistance on scripts.

Tutorial Videos
What better way to learn something new than watching a demo? Ben Schwenk, former product manager and now Chief-of-Staff at Idera, shares with us a nifty example of how you can use UltraEdit’s built-in scripting and the popular AI and natural language tools to greatly simplify the process.

You will also learn how to activate some of UltraEdit’s latest improvements such as WebView2 and the new scripting engine added in UltraEdit 2023.0.

Some other examples of where you can use scripts

The possibilities are endless with scripts. But of course, there are some use cases wherein writing a script might be excessive. Familiarizing with concepts and common use cases will help in deciding whether a script might be useful. Here are some examples of where you might use scripts.

  • Adding specific parameters to fine-tune find and replace operations
  • Searching and iterating through a whole file to find complex patterns 
  • Viable substitute for convoluted regex expressions
  • Speed up navigation operations via filters and if/then statements
  • Repeatedly analyzing textually unique but structurally similar files
  • Other scripting examples…

Limited Time: Webinar on scripting

ultraedit scripting webinar

Here’s an even better way to learn something other than watching a demo—seeing it live!

Take a guided tour through UltraEdit’s application scripting feature set from the product experts themselves. From writing your first script, to automating everyday tasks, to complex file and data reconfiguration, we will get you started with one of the most powerful but often overlooked tools in UltraEdit’s arsenal.

This webinar is intended for developers of all skill levels—whether you’re a scripting savant or a newbie learning the ropes, discover how to effectively use UltraEdit’s new scripting capabilities to increase productivity. There will also be a Q&A Session at the end of the webinar so better tune in live on Thursday, June 1, 2023 at 10 AM CST.

Sign up for the webinar now!

The post Scripting 101: Using UltraEdit’s integrated scripting engine appeared first on UltraEdit.

]]>
https://www.ultraedit.com/blog/scripting-101-using-ultraedits-integrated-scripting-engine/feed/ 0