
Ultraedit versions windows#
This Windows application allows you to write any kind of text, having a lot of features that most average users need. Some users would like to have the line numbers displayed, so that they can quickly find an error inside their code.įortunately, there are Notepad alternatives which have this feature and many others. The problem with Notepad is that it's really limited and includes few features, especially when it comes to writing source code. But these requirements on data structure are not verified by the script.The Windows Notepad utility is really useful for quickly writing any kind of text, from recipes to reminders. It is of course required that all lines start with same AM x and all lines have same amount of AM x in same order and no AM x exists twice on a line. It is also verified that at least one line starts case-sensitive with AM x as a minimal protection against running this script on wrong file. A message box is displayed if active file contains one of these two characters being selected in this case in the file preventing data alignment by this script. It is verified that the active file on execution of the script does not contain the character « or the character » because of those two characters are used inside the script during execution for data alignment. That was tested by adding two more data columns with AM 7 and AM 8 and running the script once on a file containing only AM 1 at beginning of each line. The number of data columns identified by AM x, with x being a digit in range 0 to 9 which can occur one or more times after AM, can vary from one to nearly unlimited. I tested it on provided example data as well as a file with 220,000 lines and a file size greater than 16 MB. The script was tested with UltraEdit for Windows v22.20 and should work with all UltraEdit versions supporting scripts. If (typeof(lumnModeOff) = "function") lumnModeOff() Įlse if (typeof() = "function") () Process this loop for all data columns in file.įor (var nDataColumn = 0 nDataColumn 0) // Is any file opened? Replace string for final data replace to align a data column. Current maximum number of characters of the currently longest found data value of the current data column. Current column in file at end of the currently line to beginning of identifier of current data column. Number of characters in each line from beginning of the first line and must be removed from array for that reason. The last string is an empty string because of « at end of move the caret back to top of the file which cancels the selection. splitting this line up into substrings using « as separator and

Select the first line of the file, get it loaded into memory with Remove all spaces at end of all lines and append « at end of all lines. ssageBox("The file contains no value matching expression \"^AM\\d+ +\" and is not further processed for that reason.") The characters « and » should never exist in the file. and having one or more digits by « left to the keyword and » right to Replace all spaces around all words starting with AM in upper case replace all to make sure having finally really a fixed column width file. Replace each horizontal tab in entire file by a space using a simple normal " and cannot be processed because of that character.") ssageBox("The file contains character " + +


The Perl regular expression finds use also those parameters. Replace all executed on entire file to align the data columns. Define the parameters for the case-sensitive Perl regular expression Is it possible that some data are enclosed in double quotes and all whitespaces (spaces, tabs, newline characters) inside double quoted data value should be interpreted as part of the data value and never as separator between the data values? How many spaces should be used between the data columns in output: two, three or four spaces? Or should just AM22, AM23 and AM24 be interpreted as column separator and the data between should be not modified with exception of inserting additional spaces where required left to AM23 and AM24.Īre there always exactly 11 respectively 3 data columns? Should two or more spaces or two or more spaces or tabs or just a single space be interpreted as column separator?

What should be interpreted as column separator on processing the input file? If the answer on question above is no, because the input file is not a TSV file: Is the input file a CSV file using horizontal tab character as column separator as many CSV files also known as TSV file? There are some information missing before a script can be coded for this task.
