Table of Contents


edhead - examine and edit ERP data headers


edhead [-w] datafile


edhead can be used to examine the header of any ERP format data file. If invoked with the -w option, the datafile is opened for both reading and writing. In this mode one can thus alter values in the headers of the various data bins by using the appropriate commands. Otherwise, one is restricted to examining the data header. This ploy is designed to prevent inadvertently destroying data.

Once invoked, edhead responds to a number of commands. These include help, which gives a summary of the commands and their formats; exit, which causes program termination; NNN (a non-negative decimal integer), when alone causes edhead to retreive the header for that data bin and display it. NNN (a bin number) followed by a header keyword and one or more arguments requests that the specified header variable(s) be set to the new values supplied. edhead maintains a notion of the current bin, which is the last bin accessed, in a manner similar to line-oriented text editors. Hence, it is not necessary to precede header keywords with the bin number if the alteration is to be made on the current bin. In addition, one can type * in place of NNN if one wishes to alter all the bins in the data file. In the description which follows, [NNN] refers to an explicitly typed bin number (witout the square brackets), an *, or possibly nothing if the appropriate bin number is the current bin. Headers can only be altered if the -w flag was included in the invocation and the file is a disk file. The header keywords are exactly those printed out when a header is displayed on the screen.

There are four classes of header variables: those containing single integer values, those containing an array of integer values, those containing a single descriptor string, and those which contain an array of descriptor strings.

Header variables which are single integers include: event, epoch, chans, sums, tpfuncs, pp10uv, verpos, odelay, totevnt, clktick, timehi, timelo, condcode, presampling, trfuncs, totrawrecs, totrejects, binnumber, and cprecis. The command format for these is:

[NNN] header_keyword value
where value is the new value. Remember that if NNN is absent, the current bin is used, and if NNN is a single asterisk "*", all bins in the datafile will be altered.

Currently the only header variable which consists of an array of integers is rejcounts. To change one element of this array, enter:

[NNN] rejcounts index value
where index is between 0 and 7 inclusive, and value is the new value of the element.

Four header variables consist of strings of up to 39 characters. These are : expdesc, subdesc, condesc, and bindesc. These can the replaced with two consecutive lines beginning with:

[NNN] header_keyword
The following line should contain the ASCII descriptor - if too long, it will be truncated. Note that the descriptor can be preceded by tabs or blanks; these too will be removed prior to filling the header.

The final class of header variables is the arrays of descriptors. One element in one of these arrays can be altered by employing a command of the form:

[NNN] header_keyword index
The next line should contain the ASCII descriptor as above. The index selects the element in the array which is to be replaced, and should be between 0 and 7 inclusive if header_keyword is rejdesc or prfdesc, or between 0 and 16 inclusive if chndesc.


One should know what one is doing when altering header variables. Most data processing programs rely on header values for critical information and data can be ruined if they are improperly tampered with.

See Also



edhead complains if the -w flag was not employed and an attempt is made to alter a header variable.


Jonathan C. Hansen


It is difficult to keep up-to-date with all the header changes that have been implemented and that are planned. Be sure to re-display the bin and check that the appropriate changes have been effected when modifying header variables.

Table of Contents