
The script is the first time executed on active file.The active file contains just the two lines as posted above and caret is at top.The script starts searching for next occurrence of first entered string always from current caret position in active file.Īs a special feature the two entered strings to find must not be entered again if this script is executed on same file more than once and if on previous run the two lines rectangular block was indeed found in active file from current position of caret to end of file. Otherwise the script continues searching for next occurrence of first string in file until the two lines rectangular block is found or the first string could not be find up to end of file. If this is indeed the case, the two found strings are selected in column mode and as a special feature the name of the active file with path and the two entered strings are copied to user clipboard 9. The script searches in file first for the first entered string and if found checks, if the line below at same starting column has the second entered string. On first run of this script on a file the user is prompted for the two strings of the two lines rectangular block to find anywhere in the file. Next add this script to the Scripts List without or with a hotkey or chord assigned to the script for quick execution by key.
Ultraedit column mode code#
Note: The script works only if the rectangular block to find does not contain horizontal tabs.Ĭopy the script code into a new ASCII file and save it for example with name FindTwoLinesRectangularBlock.js in directory %APPDATA% \IDMComp\UltraEdit\scripts which first must be created if not already existing. from this position once again for first string to find. Set caret back to end of first found string and search clipboard 9 for next run of this script on same file. Store the strings to find with file name with path in user If (typeof(lumnModeOn) = "function") lumnModeOn() Įlse if (typeof() = "function") () rectangular block in column mode from bottom left to top right. Rectangular block to find indeed found in active file. Starts the selected string with second string to find? Select everything to end of this line. Set caret to next line at same column as beginning of found string. Var nNextColumn = nActiveColumn-sFirstToFind.length Get line and column number of caret which is at end of found string. string can't be found anymore in active file. end of file in a loop until either the block is found or the first Search for the first string to find from current caret position to expression find used to find first string in active file. Define the parameters for the case-sensitive non regular SSecondToFind = UltraEdit.getString("Please enter string to find second:",1) SFirstToFind = UltraEdit.getString("Please enter string to find first:",1) execution of this script on active file ask user for the 2 strings. If there are no strings stored in user clipboard 9 from a previous If (typeof(lumnModeOff) = "function") lumnModeOff() Įlse if (typeof() = "function") () If ((()) & bColumnMode & sFirstToFind.length) a rectangular block selected from a previous script run to avoid

Set caret to right by one character on first line if there is still If (typeof(lumnMode) = "boolean") bColumnMode = lumnMode Įlse if (typeof() = "boolean") bColumnMode = object in UltraEdit for Linux and for Mac.
Ultraedit column mode windows#
UltraEdit for Windows and UEStudio, but a property of the document The column mode property is a property of the UltraEdit object in if the active file is the same as on previous execution of the script. Get data from a previous run of this script stored in user clipboard 9 Var nActiveClipboard = UltraEdit.clipboardIdx OBV N N N N N N N N N N N N N N N N N N N N N N N N NĬode: Select all if ( > 0) // Is any file opened? TYP R R R R R R R R R R R R R R R R R R R R R R R R RĬLD FW FW FW FW FW FW FW FW FW FW CL CL CL CL CL CL CL CL CL CL CL FW FW FW SCĬIG 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8ĬCG 6 6 7 7 8 8 8 7 8 8 8 8 8 6 6 6 6 6 6 7 7 6 6 6 6 PCO N N N N N N N N N N N N N N N N N N N N N N N N N WGS NG NG NG NG NG NG NG NG NG NG NG NG NG NG NG NG NG NG NG NG NG NG NG NG NG Code: Select all KCRP GFS LAMP GUIDANCE 1400 UTC
