User's Guide



FMEW is a text editor intended for large ASCII files. It has special functions, which enable to perform:

FMEW uses memory RAM to create a large text page. The width of this page (maximal number of characters per line) is defined by the user at command prompt as a parameter (default value is 158). The length of the page (maximal number of rows which FMEW can handle) depends on the page width according to the following rule:

(width of page + 2) x (length of page) = size of free memory RAM

In spite of this rule, length of text page cannot exceed 64000 rows. Most of the special functions are based on the block definition, that is on a rectangular area defined by upper left corner (start of the block) and lower right corner (end of the block). If the block is correctly defined, it is marked by inverse display (black text on white background).

How to run program

FMEW can be run using command at console prompt:

FMEW [param1]/[*] [param2]/[*] [param3]/[*] [param4]

param1 = name of input file
param2 = page width (default 158 characters)
param3 = page length (default 64000 rows)
param4 = initial line of cursor

C:\>FMEW * 120 - new text with page width 120 characters will be edited
C:\>FMEW MER.1 - file MER.1 will be edited with page width 158 characters
C:\>FMEW MER 3000 - file MER will be edited with page width 3000 characters

When exiting FMEW (Esc key), the following question appears:
"Save ? (y/n/file name)" or, if new text was edited:
"Save ? (n/file name)"
If the answer is y (yes), the input file will be replaced by contents of the text page. If  n (no) is entered, FMEW will exit without saving the text. If a new file name is entered, FMEW will save text in the file with this name.

Screen description

As soon as FMEW is started, the window bar contains information about cursor position (C - column, R - row). Last row is intended for status information and also for conversation. All warning and error messages are displayed at this row. Symbols at the information row have the following meaning:

INS/OVR ... identification of editor's mode (it can be altered by  Insert  key)
R/D ....... measurement of angles in calculations (radians/degrees)
W= ........ selected page width - maximal number of characters per row
L= ........ overall number of rows in the edited text
M= ........ maximal number of rows, that can be handled by the editor
B= ........ row range of block. If no block is selected, B=0

Summary of shortcut keys


Shortcut key Meaning Shortcut key Meaning
Right arrow character right Left arrow character left
Up arrow character up Down arrow character down
Ctrl+Right 9 characters right Ctrl+Left 9 characters left
Ctrl+Up 9 characters up Ctrl+Down 9 characters down
Home start of line End end of line
Ctrl+Home starting column of block Ctrl+End ending column of block
Shift+Home start of block Shift+End end of block
Page Up window up Page+Down window down
Ctrl+Page Up start of text Ctrl+Page Down end of text
Del delete character / connect rows Backspace delete character to left
Alt+E delete to the end of the line Ctrl+Y delete row
Enter new row / divide row Alt+Y delete rows in the block range
Ctrl+Enter space in all rows (in block range) Ctrl+Backspace delete character in all rows (in block range)
Alt+P save cursor location (for Alt G) Ctrl+P skip cursor to the specified location
Alt+Q word in text -> register Alt+A word in register -> text
F3 enable / disable cache for frequently used words F4 save word at cursor into cache
Ins insert / replace

Search / change string

Shortcut key Meaning Key Meaning Shortcut key Meaning
Ctrl+F string search Ctrl+Shift+F case insensitive string search Ctrl+L repeat last string search
Alt+F search regexp Alt+Shift+F case insensitive regexp search Alt+L repeat last regexp search
Ctrl+A change string


Shortcut key Meaning Shortcut key Meaning
F7 start of the block F8 end of the block
Ctrl+F7 initial column of the block Ctrl+F8 ending column of the block
Alt+F7 initial row of the block Alt+F8 ending row of the block
F9 copy block F10 move block
Ctrl+F9 copy block horizontally Ctrl+F10 move block horizontally
Ctrl+I fill the block with specified string Ctrl+E fill spaces in the block by specified string
Alt+U convert characters in the block to upper / lower case F6 word in text -> block
Ctrl+W write contents of the block to file Ctrl+R read contents of file as a block
Ctrl+D switch block display


Shortcut key Meaning Shortcut key Meaning
Ctrl+C enter formula Shift+F8 angles in degrees / radians
Ctrl+X matrix operation Ctrl+T matrix transposition
Alt+F1 partial sum of number column Alt+F2 sum of numbers in the block
Alt+F3 average of numbers in the block Alt+F4 minimum of numbers in the block
Alt+F5 maximum of numbers in the block Alt+F6 standard deviation of numbers in the block

Database functions

Shortcut key Meaning Shortcut key Meaning
Ctrl+S sort text inside selected block Alt+X find information in the text using logical term
F5 link lines from specified file Alt+T export whole text (selected block) into DBF format

Automated text entering / filling

Shortcut key Meaning Shortcut key Meaning
Ctrl+G fill column(s) / row by numbers Alt+H fill positions predefined by character(s) ×
Alt+O write character ~


Shortcut key Meaning Shortcut key Meaning
Alt+F9 start macro recording Alt+F10 stop macro recording
Alt+I specify repeating macro Alt+0 ... Alt+9 perform macro 0 ... 9
Alt+M edit macro

Miscellaneous functions

Shortcut key Meaning Shortcut key Meaning
Ctrl+F1 fix row Ctrl+F2 fix column
Ctrl+F3 release fixed rows Ctrl+F4 release fixed columns
Ctrl+N display name of input file and block Alt+N catch file name from text
Ctrl+Z write row  at cursor into file SELECT Alt+Z format paragraph
Shift+F4 inverse display colors Ctrl+V change text color
Alt+J align text into columns Ctrl+B remove right spaces


The block is defined using shortcut keys  F7 (start of the block - upper left corner) and  F8 (end of the block - lower right corner). Let  c1  and  r1  denotes column and row of the block start, and  c2 and r2 denotes column and row of the block end. The block is correctly defined, if and only if  c1<c2 and  r1<=r2.
Correctly defined block is marked by inverse display (black text on white background). If  Ctrl+D  is pressed, block is not visible by the inverse display, but it remains defined - the inverse display is restored again by using  Ctrl+D.
For easy change of long blocks there are shortcut keys  Ctrl+F7 and  Ctrl+F8, which are intended for initial and ending column change (row range of the block is not changed). It is possible to copy (move) block into another place using shortcut key  F9 (F10). The block is copied (moved) so that the upper left corner of the copied area is identical with the cursor position. This function is realized only in the replace mode - that means, if there is any text in the destination area, it will be replaced. In cases, when the text has not to be replaced, it is necessary to create free space using shortcut key  Enter  or  Ctrl+Enter.
There is a possibility to copy (move) the block in the horizontal direction using key  Ctrl+F9 (Ctrl+F10). Keys  Ctrl+R  and  Ctrl+W  are intended for reading and writing block contents from / to disk. Block reading is performed only in the replace mode!

Search and replacement functions

FMEW enables to search in the text using string or regular expression. String search is invoked by shortcut key  Ctrl+F  (case sensitive search) or by shortcut key  Ctrl+Shift+F (case insensitive search). Shortcut key  Ctrl+L  enables to repeat last search. If a block is selected, the string is searched only within the block.
String replacement is invoked by pressing Ctrl+A. In the lower row the following prompt appears:

"replace ? (y/n/*/Esc)"

If  y (yes) is entered, the string marked by red letters is replaced and the following occurrence of the string is found. If  n (no) is entered, replacement is skipped. Answer * causes replacement of all occurrences of specified string to the end of the text (or to the end of a block, if the block is selected). If  Esc  is pressed, replacement is canceled.

Regular expressions

Keys  Alt+F and  Alt+Shift+F are intended for searching in the text using simple regular expressions (case sensitive and case insensitive). Regular expression is a pattern, which represents certain set of strings. FMEW implements the following elements of regular expression:




match any character


match 0 or more occurrences of the previous character


match 0 or one occurrence of the previous character


match character from the set of characters


match characters not in the set of characters


match digit (0,...,9)


match letter (a,...,z,A,...,Z)  


match digit or letter (0,...,9,a,...,z,A,...,Z)


escape character - the following character loses its special meaning


  1. Characters  ., *, ?, [, ], #, &  and  $  are special. To match the special character, use \ in front of it.
  2. The set of characters can be defined by the list of elements (for example [abcxyz]), by the range (for example [a-z]) or by any combination of the list and the range (for example [0-9abc]).
  3. The element + (one or more occurrence of previous character) is not implemented in the FMEW. It can be substituted - see the following examples.
  4. It has no sense to use only repeating elements (constructed using  *  or  ?) in the regular expression. If such regular expression is used (for example .* *[a-z]*), FMEW may produce uncertain result.


Regular expression


Text example(s)

.* .alk.*

Find text containing space followed by
any character and string alk
will talk
many balk


Find text starting with b or B followed by
string ill


Find text starting with This This function is realized only in replace mode


Find text starting with This and ending with . This function is realized only in replace mode.


Find text starting with capital letter
and ending with .
This function is realized only in replace mode.


Find text not starting with capital letter
and ending with .
this function is realized only in replace mode.

 .* ##* .*

Find text containing integer number
separated by spaces
      DO 650 I=1,MAXC

.*KL... .*

Find text containing KL followed by
any three characters and space
Well KL116 has special function.
Wells BR26 and KL045 were closed.


Calculation according to the entered formula is started (only if a block is defined) using shortcut key  Ctrl+C. Formula is entered at the last (conversation) row using the following symbols:

0 1 2 3 4 5 6 7 8 9 . + - * / ^ s c t a e ( )  where

+ - * / ^    are symbols for mathematical operations (addition, subtraction, multiplication, division and involution)
s c t a l e  are symbols denoting mathematical functions (sine, cosine, tangent, arcustangent, logarithm and exponential)
Formula can be edited only using Esc (delete formula) and Backspace (delete character left).


Mathematical notation

Notation in FMEW



While entering formula, it is possible to use parameter instead of the number. When shortcut key  P  is pressed, cursor skips into text page and the following message appears in the lower row:

"Mark parameter position as a block and press Enter"

In the next step the user has to mark (as a block) column of numbers, which are to be substituted into formula. After pressing key Enter, capital letter (A,B,...) appears in formula instead of previously typed P. Formula is completed using key Enter and the following message appears:

"Move cursor to the result position and press Enter"

Cursor again skips into text page and can be located at desirable position. Now key Enter has to be pressed again and the following message appears:

"Result width and number of decimal places: 9 4"

Numbers 9 and 4 can be modified and after pressing Enter the calculation will be performed in the row range of block.
Before formula entering, angle measurement can be altered by Shift+F8 (radians / degrees).
Following example illustrates the block definition during the calculation according to the formula A+B/10, where values from second column are to be substituted instead of  A  and values from the first column are to be substituted instead of  B. Width of result was specified as 8, number of decimal places as 3.

  cursor position determines location of the result
                         |                          result
                         |                            |
        15.45 2.345 210        15.45 2.345 210     3.890
        17.01 2.831 214         17.01 2.831 214     4.532
        16.46 3.001 198         16.46 3.001 198     4.647
        13.24 2.223 199  --->   13.24 2.223 199     3.547
        15.90 2.224 187         15.90 2.224 187     3.814
        17.02 2.456 203         17.02 2.456 203     4.158          
          |     |
          |     block for definition of the first parameter (A)
          block for definition of the second parameter (B)

Statistical functions

Statistical functions are invoked by pressing one of the following shortcut keys:
 Alt+F1    partial sum of numbers in column    Alt+F4    minimum
 Alt+F2  sum  Alt+F5  maximum
 Alt+F3  average  Alt+F6  standard deviation  

Any statistical function can be applied only if a block is selected and has sense only if the block contains column(s) or row(s) of numbers. Statistical value will be calculated from a column of numbers or from a row of numbers - it depends on the cursor position. If the cursor is positioned at the right side of the block, value is calculated from all rows (it is assumed, there is a free area for result). Result is located at cursor position after the following prompt is answered:

"Result width and number of decimal places 9 4".

If the cursor is located at a space column preceding the column of numbers, statistical value is calculated from this column. The location of result(s) is determined by the position of the cursor. The following example illustrates using of statistical functions.

Calculation of statistical function for rows

  cursor position before pressing Alt+F4           result
                     |                               |
     2.34 2.32 1.98                2.34 2.32 1.98  1.98
     2.15 2.26 2.03       ----->    2.15 2.26 2.03  2.03
     2.56 2.34 2.06                 2.56 2.34 2.06  2.06
     1.78 2.45 2.11                 1.78 2.45 2.11  1.78

Calculation of statistical function for column

     2.34 2.32 1.98                 2.34 2.32 1.98
     2.15 2.26 2.03       ----->    2.15 2.26 2.03
     2.56 2.34 2.06                 2.56 2.34 2.06
     1.78 2.45 2.11                 1.78 2.45 2.11
                                             8.18 ---- result
  cursor position before pressing Alt+F2

Text alignment into columns

Sometimes it is desirable to align text and number items so that text items have to be aligned to the left and number columns have to be aligned to the right. This enables function invoked by shortcut key Alt+J. The function is applied in row rage of selected block.
Firstly, the user must specify at least one item separator (which is usually space), but up to seven separators can be selected - each of them will be considered as an item separator. The default separators are space, comma, semicolon and tab.
Secondly, the user has to specify new separator - string containing up to three characters. In the following example, two spaces are used as a new item separator:

 KL110   123.45  9874.56             KL110  123.450  9874.56
  KL14   12.135  12.14               KL14    12.135    12.14
KL123   111.450  114.0     ----->    KL123  111.450   114.00
   KL2    2.0    540                 KL2      2.000   540.00
BR145 23.5 700                       BR145   23.500   700.00


Records inside a block can be sorted according to a sorting key. The sorting key is a string with maximal length 64 characters. During sorting process, characters (more exactly their numbers from ASCII table) are compared - that is why, the following rules should be respected:

A)  If the sorting key is column of numbers, then numbers should be aligned to the right with the same number of decimal places.
B)  If an alphabetical sorting is performed, column of alphabetic items (sorting key) should be aligned to the left.

To align columns of text, use the function  Alt+J - see above.
Sorting is invoked by shortcut key  Alt+S (a block must be selected before this key is pressed), when the following message appears:

"Move cursor to the start of sorting key and press Enter"

and cursor skips into text page, where the user can define start of the sorting key. The same process is repeated to determine the end of sorting key. Finally, the type of sort is specified after answering the question:

"Sort type (ascending-a/A, descending-d/D, do not sort-*)"

If the type of sort is specified by capital letters (A or D), sorting key is converted to upper case (of course, only for comparison purposes). Sorting can last a few seconds, especially if the block is very long. The following page illustrates sorting process.

      product          price         product          price
       name   quantity  $             name   quantity  $
       NU  74    4    325             NU   9   11   1120
       NUA 72    3    350             NU  73   12   1090
       NU  73   12   1090             NU  74    4    325
       NU   9   11   1120             NUA 72    3    350
       NUB 72   13   1560   ------>   NUB  1    9    870
       NUB  1    9    870             NUB  3    6    540
       NUD 72   13   1300             NUB 72   13   1560
       NUG 72   10   1430             NUC 72   11    980
       NUC 72   11    980             NUD 72   13   1300
       NUB  3    6    540             NUG 72   10   1430
            -- end of sorting key
      start of sorting key

Logical selection of rows

Logical selection enables to find information in the row range of the block. It is started by shortcut key  Alt+X. The user is then expected to enter logical term using the following characters (the list is sorted according to a priority):

z ....... empty row (row with zero length)
f ....... first non-empty row following an empty row
l ....... last non-empty row preceding an empty row
d ....... the following row is the same
<,=,> ... string relational operators less than, equal, greater than
e ....... the following string exists in the row
m ....... text in the row have to match the following regular expression
n,a,o ... logical operators not, and, or

Strings must be closed between two characters " - for example "101A". String relational operators  <, =, >  can be followed (or preceded) by the parameter, which is determined by the same way, as in case of  formula (see above). Result of the logical selection is one-character column, at which an asterisk (*) appears, if the logical term gets true value (otherwise there is space).
l a m"101AB.*" ...     last non-empty rows preceding an empty row and starting with string 101AB will be marked by the asterisk.
(e"[") a n(e"]") ... all rows, in which character [ exists and character ] does not exist, will be marked by the asterisk.

Linking lines from file

There is a possibility (using shortcut key F5) to link lines from specified file into the text page. If a block is selected and key F5 is pressed, strings contained in the block (searching keys) are successively searched in the specified file. The first row containing searched string is then transferred into the text page.

                       block selected before pressing F5    
    x      y      well |    
  153.4  785.3    KL-121    Well: KL-121  Filter: 234.7 - 245.6
  562.4  546.1    KL-130    Well: KL-130  Filter: 214.5 - 233.2
  121.1  121.8    KL-143    Well: KL-143  Filter: 276.1 - 295.7
  342.3  534.2    KL-144    Well: KL-144  Filter: 234.4 - 255.1
  rows in the text page       linked rows from specified file

If lines in both files are sorted according to searched strings, the linking process is quite fast. In the opposite case, the process can be slow, especially if long files are processed. This function enables to transfer information contained in another file(s) into the text page.

Export into DBF format

Shortcut key Alt+T is intended for the export of whole page (or a block, if it is defined) into the file in DBF format. Such file can then be used as an input file for database programs (dBASE, FOXPRO, ...) or for spreadsheets (QPRO, LOTUS, EXCEL, ...). FMEW determines width and number of the decimal places in number-columns. Also determines the date in the format DD.MM.YY - day, month and year (character ".", "/" or "-" can be used as a delimiter). Columns containing only numbers will be transformed as a numerical items, columns containing only date will be transformed as a date items and in other cases, columns will be transformed as a character items. Names of the items can be listed in the separate file file_name.HDF (file_name  is the name of the edited file without extension) in actual directory (each name of item must be on the extra row - do not forget to satisfy conventions for names of DBF items!). It the file file_name.HDF does not exist, FMEW will create it's own names.

Number entering

Columns or row of numbers can be comfortably entered using shortcut key  Ctrl+G. If this function is invoked, the user must at first specify, if columns or row will be entered. Number width and number of decimal places must be specified as well. If the number of decimal places is negative, entered numbers will be displayed in exponential form. Finally, on the screen appears pattern for entered number. Numbers are entered in the conversation row and the following keys can be used for editing:
+, -, 0,...,9,  E,  Right arrow, Left arrow,  Backspace,  Del,  Esc, Home  and  End.
Number is written to the text page after key  Enter  is pressed. Function is finished as soon as the empty string is entered.
number width   number of decimal places


example of number





Fast text filling

Shortcut key Alt+H is intended for fast text filling at predefined positions. If  Alt+H  is pressed, the first occurrence of predefined position is found. Predefined position must be typed using characters  '~', '.' and  'E' (see the following example). Predefined position is marked as a little block and FMEW is awaiting text or number. If the key  Enter  is pressed, text or number is written at predefined position in the text page. If empty string is entered, the function is finished.
Example: Let the following form is to be filled:

Name of well ~~~~~~                  Date of measurement ~~.~~.~~
Depth ~~~.~~~E~~                      Temperature ~~.~ [`C]
Atmospherical pressure ~~~~.~ [kPa]   Water level ~~~~.~~ [m]

After entering  KL-011, 12.09.94, 225.65, 17.3, 987.3   and  198.33  the form will look like this:

Name of well KL-011                   Date of measurement 12.09.94
Depth   2.557E+2                      Temperature 17.3 [`C]
Atmospherical pressure  987.3 [kPa]   Water level  198.33 [m]

Character ~ is entered using key  Alt+O.


The macro is file containing sequence of pressed keys and can be performed by pressing a single key. Recording of the macro is started with shortcut key  Alt+F9. At the conversation row appears "Number of macro". The user must enter number in range  0,...,9  and the file  Mi.MAC  is opened in actual directory (i is entered number of the macro). All pressed keys are then recorded, until shortcut key  Alt +10  (end of macro) is pressed. Macro recording is indicated at the conversational row by characters  Mi, where i is number of macro. Macro can be performed using key  Alt+i. For example, if  Alt+7  is pressed, sequence of keys contained in the file  M7.MAC  is performed (if such file exists).
During macro recording, another macro is not allowed to be performed (any of shortcut keys  Alt+0,...,Alt+9  is not allowed to be pressed). If it happens, preceding macro is closed. Similar rule holds for key  Alt+F9.
This limitation can be eliminated using the program  MACRO.EXE, which enables to combine several macros into one file. The program MACRO.EXE will create file  M0.MAC, which links several macros specified as a parameter. For example:

C:\>MACRO 7912

will link files  M7.MAC,  M9.MAC,  M1.MAC and  M2.MAC into one file M0.MAC.
To ensure "repeating" macro functionality, press  Alt+I  key just instead of  Alt+F10  shortcut key. In this case, the macro will be performed repeatedly, until last row (or column) is detected. Repeating of macro is also interrupted, if searched string is not found  (Ctrl+F,  Ctrl+L  or Ctrl+A  functions), or by user's pressing  Esc  key.
Macros can be edited using a simple macro-editor, which is invoked by key  Alt+M. The user must enter the number of macro  (0,...,9) and afterwards macro-editor is active - there is a sequence of key abbreviations on the screen, for example:

{ End }
{ Enter }
{ Down }
{ &I}
{ &F10 }

Remark: &  means  Alt,  ^  means  Ctrl  and  ~ means  Shift  in the names of shortcut keys.

The cursor can be moved around the screen using keys Down arrow,  Up arrow,  Page Down  or  Page Up. Key  Del  is intended for deleting keys contained in the macro and  Ins  is intended for key inserting. Shortcut key  Shift+Tab  can be used to switch on/off inserting mode permanently. The size of edited macro is determined by the amount of free memory, but it cannot exceed 64000 bytes. Macro-editor can be finished by shortcut key  Esc.

Matrix modification

Shortcut key  Ctrl+X  enables to perform operation with all elements of the matrix: multiplication by constant, constant addition and absolute value. Shortcut key  Ctrl+T  enables matrix transposition (exchange of rows and columns). In both cases, the modified matrix is saved to the disk as a file (MUL.MAT in case of  Ctrl X  and  TRA.MAT  in case of  Ctrl T) and than is read from disk as a block. Reading from disk must not be always complete (in this case adequate warning is displayed), especially if long rows or long columns are transposed. In any case, user has available file  MUL.MAT  and/or  TRA.MAT containing result. Modified matrix must be marked as a block and must contain only number items.

                          cursor position before pressing Ctrl T
                                                     2.34   0.11   4.22
      block containing matrix of numbers,             0.34  12.00   5.06
           which is to be modified                    9.44   5.47   4.09
                                                      6.07   0.47   6.51
 2.34  0.34  9.44  6.07 12.98  5.00  0.98  1.47      12.98   3.78   6.34
 0.11 12.00  5.47  0.47  3.78  9.21  9.22  5.45       5.00   9.21   9.45
 4.22  5.06  4.09  6.51  6.34  9.45  0.00  3.97       0.98   9.22   0.00
                                                      1.47   5.45   3.97

Cache for frequently used words

Frequently used words can be recorded into special file named  CACHE.FME  in the actual directory. If shortcut key  F4  is pressed, word at cursor position is recorded into the file  CACHE.FME  and from this moment it is available for quick transfer into written text. After FMEW is started, cache buffer with frequently used words is not visible. If key  F3  is pressed, FMEW starts to check each written word. When the first letters of the word are typed, FMEW looks up words beginning with these letters in the cache buffer. If there are such words, they are displayed in opened upper window and marked by red letters. User can press key Tab, select (using keys  Up arrow,  Down arrow,  Left arrow  and  Right arrow) desirable word, and by pressing Enter can transfer word into the text. A word can be also transferred with shortcut key corresponding to red letter (a,...,n). If there is only one word in the cache buffer (beginning with the first typed letters of the word), FMEW peeps and calls attention to opportunity for transferring of the word.
If this FMEW's feature is intensively used, it is reasonable to create several files with frequently used words concerning with certain topics. These files can be named according to user convenience and before using FMEW the desirable file can be renamed to CACHE.FME. The file CACHE.FME is ordinary ASCII file and can be modified by any ASCII editor. If there is too many words in CACHE.FME, looking up of words may unacceptably slow down the work with the editor.

Miscellaneous functions

If any of shortcut keys Alt+F1,..., Alt+F6, Alt+C, Ctrl+T, Ctrl+X, or  Ctrl+G  is pressed unintentionally, it is possible to cancel corresponding function. User can enter 0 as a result width answering the prompt:

"Result width and number of decimal places: 9 4"

and unintentionally invoked function will be canceled.

If  Ctrl+N  is pressed, name of edited file and name of block (if a block was read using shortcut key  Ctrl+R)  is displayed at lower row. If shortcut key n (b)  is then pressed, name of the file (block) is transferred into the text page.

If  Ctrl+Z  is pressed, row at cursor position is written (added) into the file SELECT.

Return to main page.