SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 1 Vol 2

READ

Name:
    READ
Type:
    Support Command
Purpose:
    Reads data into variables
    1. from an ASCII mass storage file;
    2. from within a CALLed DATAPLOT sub-program;
    3. from the terminal.
Description:
    The READ command is primarily intended for reading from the terminal or from ASCII files. Dataplot has limited support for binary data files (see the Note sections below with regards to reading Fortran unformatted files and image data).

    Also, Dataplot does not currently support directly reading files from other statistical/spreadsheet programs or database files. Some support may be provided in future releases, but for now you need to save the data from these programs in an ASCII file in order to read them into Dataplot. XML based data files are becoming increasingly popular as well. At this time, Dataplot does not support XML based data files.

    IDEAL CASE

    By default, Dataplot assumes rectangular data files containing numeric data where the data columns are separated by one or more spaces. Commas or tabs may be used as delimiters as well.

    In this case, you can read the file with a command like the following:

      READ FILE.DAT Y X1 X2

    The first argument after the READ is the name of the ASCII file. The remaining arguments identify the variable names. Variable names can be up to eight characters long and should be limited to alphabetic (A-Z) and numeric (0-9) characters. Although other characters can in fact be used, this is discouraged since their use can cause problems in some contexts. Variable names are not case sensitive (Dataplot converts all alphabetic characters to upper case).

    Dataplot recognizes the first argument as a file name if it finds a "." in the name. If no "." is found, Dataplot assumes the first argument is a variable name and it tries to read from the keyboard rather than the file.

    For this ideal case, the following are the basic rules.

    1. If there are k variables listed on the READ statement, then each line image must have at least k data values. Only the first k data values are read (this is how the READ command differs from the SERIAL READ command), and these are read into successive elements of the individual variables. Thus

        READ X Y
        1 1 1
        2 4 8
        3 9 27
        END OF DATA

      results in X containing the 3 elements 1, 2, and 3; Y containing the 3 elements 1, 4, and 9; and the values 1, 8, and 27 not being read at all.

    2. In scanning for the k variables, the full line image is scanned. By default, the full line image is 255 characters.

      The COLUMN LIMITS can be used to restrict the read to certain columns. The case where the data line is longer than 255 characters is discussed below.

    3. Data values on a line image must be separated by at least one blank or comma. Non-printing characters, such as tabs, are treated as spaces.

    4. Data values may be free-format. That is, they need not be aligned in specific columns. If your data file is aligned in specific columns, you may be able to significantly speed up the read by specifying a format for the data. This is discussed below.

    5. The format of individual data values is general. It can be integer, floating point, or exponential. It is stored internally as a single precision real number.

      Support for character data is discussed below.

    6. All reads start from the beginning of the file. The SKIP and ROW LIMITS can be used to skip header lines are to restrict which row of the file are read.

    7. The analyst need not be concerned about the number of observations for each variable; DATAPLOT automatically determines and reports this value at the end of the read.

    8. The read terminates when a line image is encountered which consists of

      END OF DATA

      or

      END DATA

      or when the end of the file is reached.

    Many ASCII files will not be in the "ideal" format. The remainder of this section discusses various issues that may cause problems when reading ASCII files and provides suggestions on how to deal with these issues. The following topics are discussed:

    1. Viewing ASCII files within Dataplot
    2. Header lines/restricted rows or columns
    3. Long data records
    4. Automatic variable names
    5. Reading fixed columns
    6. Reading variables with unequal lengths
    7. Reading character data
    8. Reading row oriented data
    9. Comment lines in data files
    10. Reading Excel files
    11. Cut and paste
    12. Comma as decimal point
    13. Missing values and undefined numbers

    If you create the ASCII file yourself, it is recommended that you create it with variables of equal length (pick some numeric value to signify missing data) and with data items separated by one or more spaces. Inclusion of a header giving a description of the data file is optional, but we find it helpful (Dataplot can skip over the header lines). When the ASCII files are created by another program (e.g., Excel), then you may have less control over the format of the file. Hopefully, most ASCII files you encounter can be handled using the commands discussed below.

    VIEWING THE ASCII FILE WITHIN DATAPLOT

    In order to identify some of the issues discussed below, it is often helpful to view the ASCII file before trying to read it into Dataplot. You can do this with the command

      LIST FILE.DAT

    This will list the file 20 lines (you can change the number of lines with the SET LIST LINES command) at a time. You can then enter a carriage return to view the next 20 lines or a "no" to stop viewing the file.

    For some of the commands given below, you need to either know approriate line numbers or column numbers.

    To view the file with line numbers, enter the command

      NLIST FILE.DAT

    To identify appropriate columns, enter the command

      RULER

    This will identify the first 80 columns.

    HEADER LINES/RESTRICTED ROWS OR COLUMNS

    Many data files contain header lines at the beginning of the file that provide a description of the file. In order to skip over these lines, enter the command

      SKIP N

    where N identifies how many lines to skip.

    Most of the sample data files that are distributed with Dataplot contain a line starting with hyphens ("---"). You can use the command

      SKIP AUTOMATIC

    for these files. Dataplot will skip all lines until a line starting with three or more hypens is encoutered.

    In a related issue, if you want to restrict the read to certain rows in the file, you can enter the command

      ROW LIMITS N1 N2

    with N1 and N2 denoting the first and last rows to read, respectively.

    You can also restrict the read to certain columns of the file using the command

      COLUMN LIMITS C1 C2

    with C1 denoting the first column to read and C2 the last column to read.

    LONG DATA RECORDS

    When reading from the keyboard, Dataplot restricts a single record to a maximum of 255 columns.

    When reading from a file, Dataplot previously restricted a single record to a maximum of 132 columns. The March, 2003 version raised the default limit to 255 characters. In addition, the following command was added:

      MAXIMUM RECORD LENGTH N

    with N denoting the size of the largest record to be read.

    Dataplot accepts values of N up to 9999. However, be aware that some Fortran compilers may impose their own limit. These limits tend not to be well documented, but with modern compilers they tend to be sufficiently large that this should not be a problem in practice.

    Note that if you specify a MAXIMUM RECORD LENGTH command, you should also specify the COLUMN LIMITS command. For example,

      MAXIMUM RECORD LENGTH 512
      COLUMN LIMITS 1 512

    If you specify a SET READ FORMAT command (discussed below), you do not need to specify the maximum record length.

    AUTOMATIC VARIABLE NAMES

    Dataplot normally reads variable names on the READ command. However, many ASCII files will have the name of the variables given directly in the file or Dataplot can assign the variable names automatically.

    Specific methods include the following.

    1. Many of the sample files provided in the Dataplot installation use a syntax like
      Y     X1   X2
      ----------------
      <data values>
                 
      For these files, you can enter the commands

        SKIP AUTOMATIC
        SET VARIABLE NAMES FILE
        READ FILE.DAT

      In this case, Dataplot will skip all lines until a line starting with three or more hypens is encountered. It will then backspace to the previous line and read the variable names from that line.

      Alternatively, you can specify the number of lines to skip with the command

        SKIP N

      where N specifies the number of lines in the header. If the SET VARIABLE NAME FILE command has been given, Dataplot will look at the last line of the header (i.e., line N). If it starts with three or more hyphens, then Dataplot assumes that the variable names are on line N-1. If line N does not start with hyphens, then Dataplot assumes that the variable names are on line N.

    2. Many non-Dataplot ASCII data files will have the variable names on the first line of the file. For these files, you can enter the commands

        SET VARIABLE LABELS ON
        READ FILE.DAT

      Dataplot then assumes line one of the file contains the variable names and the data start with line two.

      This is equivalent to using

        SKIP 1
        SET VARIABLE NAMES FILE
        READ FILE.DAT

    3. If you would like Dataplot to simply assign the variable names, enter the commands

        SET VARIABLE NAMES AUTOMATIC
        READ FILE.DAT

      Dataplot will read the first line of the file to determine the number of variables. It will then assign the names COL1, COL2, and so on to the variable names. Prior to 2014/10, Dataplot used default names of X1, X2, and so on. You can specify what to use for the base of the variable names by entering the command

        SET AUTOMATIC VARIABLE BASE NAME <value>

      The use of SET VARIABLE NAMES AUTOMATIC applies to either the SKIP AUTOMATIC or the SKIP N cases.

    Note that Dataplot's usual rules for variable names still apply. That is, a maximum of eight characters will be used and spaces (commas can also be used as the delimiter and non-printing characters such as tabs will be treated as spaces) will delimit variable names. The use of special (i.e., not a number and not an alphabetic character) characters is discouraged. You may need to edit the file if the variable names do not follow these rules (more than eight characters will simply be ignored, so the issue is more one of duplicate variable names in the first eight characters).

    The SET VARIABLE NAMES <AUTOMATIC/FILE> command was implemented 2014/10. Prior to that, the SKIP AUTOMATIC worked equivalently to the SET VARIABLE NAMES FILE and the SKIP N worked equivalently to the SET VARIABLE NAMES AUTOMATIC. The default is AUTOMATIC.

    READING FIXED COLUMNS

    By default, Dataplot performs free format reads. That is, you do not need to line up the columns neatly. You do need to provide one or more spaces (tabs, commas, colons, semi-colons, parenthesis, or brackets can be used as well) between data fields.

    Many data files will contain fixed fields. There are several reasons you may want or need to take advantage of these fixed fields rather than using a free format read.

    1. If your data fields do not contain spaces (or some other delimiter) between data columns, you need to tell Dataplot how to interpret the columns.

    2. In some cases, you may only want to read selected variables in the data file.

    3. Using a formatted read can significantly speed up the reading of the data. If you have small or moderate size data files (say 500 rows or fewer), this is really not an issue. However, if you are reading 50,000 rows, you can significantly speed up the read by specifying the format.

    4. If the data fields have unequal lengths, Dataplot will not interpret the data file correctly with a free format read. It assigns the data items in the order they are encountered to the variable names in the order they are given. Dataplot does not try to guess if a data item is missing based on the columns.

      The issue of unequal lengths is discussed in detail in the next section.

    There are two basic cases for fixed fields.

    1. The data fields are justified by the decimal point.

      In this case, you can use the

        SET READ FORMAT

      command to specify a Fortran-like format to read the file. Enter HELP READ FORMAT for details.

      Using a formatted read is significantly faster than a free format read.

    2. Many programs will write ASCII files with fixed columns, but the data fields will be either left or right justified rather than lined up by the decimal point.

      In this case, you can use a special form of the COLUMN LIMITS command that was introduced with the January, 2004 version. Normally, the first and last columns to read are specified. However, you can now enter variables for the lower and upper limits as in the following example:

        LET LOWER = DATA 1 21 41
        LET UPPER = DATA 10 30 50
        COLUMN LIMITS LOWER UPPER

      That is, if variables rather than parameters are specified, separate column limits are specified for each data field. In this case, the first data field is between columns 1 and 10, the second field is between columns 21 and 30, and the third field is between 41 and 50.

      When this syntax is used, only one variable is read for each specified field. If the field is blank, then this is interpreted as a missing value.

    READING VARIABLES OF UNEQUAL LENGTH

    Dataplot normally expects all variables to be of equal length. If some variables have missing rows, this can have undesired results. Dataplot will assign the first value read to the first variable name, the second value to second variable and so on. If fewer values than variables are specified, then variables that have no data values are not read at all (even if they have values for other rows).

    If you have a data file where the columns have unequal lengths, you can do one of the following things.

    1. Pick some value to represent a missing value and fill in missing data points with that value. After reading the data, you can use a RETAIN command to remove them. For example, if you use -99 to signify a missing value, you can enter

        RETAIN Y SUBSET Y > -99

      Alternatively, you can use a SUBSET clause on subsequent plot and analysis commands.

    2. Use the variable form of the COLUMN LIMITS command as described above. By default, when a blank field is encountered, it is set to zero. You can specify the value to use by entering the command

        SET READ MISSING VALUE <value>

      This option depends on having consistent columns for each of the data fields.

    3. If your data has both columns of unequal length and inconsistent columns for given data fields, an alternative is to use a comma delimited data file. That is, separate data values with a comma. If there is no data data between successive commas, this is treated as a missing value. The default is to assign a value of zero. Alternatively, you can use the SET READ MISSING VALUE command described above.

      You can specify a delimiter other than a comma with the command

        SET READ DELIMITER <character>

      The variable form of the COLUMN LIMITS, the SET READ MISSING VALUE, and the SET READ DELIMITER commands were introduced in the January, 2004 version. The interpretation of successive commas as a missing value was also introduced in the January, 2004 version.

    READING DATA WITH CHARACTER FIELDS

    Dataplot has not previously supported character data. The one execption is that you could read row labels with the READ ROW LABEL command (enter HELP READ ROW LABEL for details). If encountered, Dataplot would generate an error message and not read the data file correctly.

    With the January 2004 version, we have introduced some limited support for character data. Specifically, we have added the command

      SET CONVERT CHARACTER <ON/IGNORE/ERROR>

    Setting this to ERROR will continue the current Dataplot action of reporting character data as an error. This is recommended for the case when a file is suppossed to contain only numeric data and the presence of character data is in fact indicative of an error in the data file.

    Setting this to IGNORE will instruct Dataplot to simply ignore any fields containing character data. This can be useful if you simply want to extract the numeric data fields in the file without entering COLUMN LIMITS or SET READ FORMAT commands.

    Setting this to ON will read character fields and write them to the file "dpzchf.dat". Note that Dataplot saves numeric data "in memory" for fast access. Since character data has limited use in Dataplot, we have decided to save character data externally to minimize memory requirements. Dataplot keeps a separate name table for the character data fields (the names for character variables are stored in the file "dpzchf.dat").

    There are some restrictions on when Dataplot will try to read character data:

    1. This only applies to the variable read case. That is, READ PARAMETER and READ MATRIX will ignore character fields or treat them as an error.

    2. Dataplot will only try to read character data from a file. When reading from the keyboard (i.e., when READ is specified with no file name), character data will be ignored when a SET CONVERT CHARACTER ON is specified.

    3. This capability is not supported for the SERIAL READ case.

    4. The SET READ FORMAT command does not accept the "A" format specification for reading character fields.

    5. A maximum of 20 character variables will be saved.

    6. A maximum of 24 characters for each character variable will be saved.

    7. The character variables from at most one data file will be saved in a given session.

    Some of these restrictions may be addressed in subsequent releases of Dataplot.

    Currently, Dataplot has limited support for character variables. Specifically,

    1. The row label can be used for the plot character by entering the command

        CHARACTER ROWLABEL

    2. You can convert a character variable to a coded numeric variable with the command

        LET Y = CHARACTER CODE IX
        LET Y = ALPHABETIC CHARACTER CODE IX

      with IX denoting the name of the character variable. These command assigns a numeric value for each unique name in the character variable.

      For the CHARACTER CODE case, the coding is from 1 to K where K is the number of unique values. The order is based on the order these values are found in the file.

      For the ALPHABETIC CHARACTER CODE case, the coding is from 1 to K where K is the number of unique values. The order is performed in alpabetical order.

    We anticipate additional use of character variables in subsequent releases of Dataplot.

    If your character fields contain non-numeric/non-alphabetic characters, then it is recommended that the character fields be enclosed in quotes. When Dataplot encounters a quote (either a single or double quote), it interprets everything until a matching quote is found as part of that character field. If the quotes are not used, then spaces, tabs, parenthesis, brackets, colons, and semi-colons are interpreted as delimiters that signify the end of that data item.

    READING ROW ORIENTED DATA

    Dataplot assumes a column oriented format. That is, a row of data represents a single record (or case) and a column of data represents a variable. If a data file has a row orientation, then this is reversed. A row of data represents a variable and a column of data represents a record (or case).

    The following example shows one way of correctly reading the data into Dataplot. Suppose that your data file contains five rows with each row corresponding to a single variable. You can do the following:

      LOOP FOR K = 1 1 5
        ROW LIMITS K K
        SERIAL READ FILE.DAT X^K
      END OF LOOP

    COMMENT LINES IN DATA FILES

    It is sometimes convenient to include comments in data files. If these comments are contained at the beginning of the file, then the SKIP command can be used. To have Dataplot check for comment lines in the data file, enter the command

      COMMENT CHECK ON

    The default comment character is a ".". That is, any line starting with a ". " is treted as a comment line and ignored. To specify a different comment character, enter the command

      COMMENT CHARACTER <char>

    with denoting the desired comment character.

    EXCEL FILES

    At the current time, Dataplot does not support the direct reading of Excel data files. We are planning to add this capability in a future release of Dataplot. Until that time, you need to save the data in Excel to an ASCII file and read that ASCII file into Dataplot.

    Excel provides the following options for writing ASCII data files:

    1. Formatted text (space delimited) (.PRN extension)

      This format will use consistent columns for the data fields. The variable form of the COLUMN LIMITS command can be used when the data columns have unequal length.

      Character fields will often not have the separating space. The variable form of the COLUMN LIMITS command can be used in this case as well.

    2. CSV (Comma delimited) (.CSV extension)

      This format will separate data fields with a single comma. Missing data is represented with successive commas. Dataplot can now (as of the January 2004 version) handle this correctly.

    3. Text (Tab delimited) (.TXT extension) Text (MS-DOS) (.TXT extension)

      These files will separate data fields with a tab character. Note that Dataplot converts all non-printing characters (including tabs) to a single space character.

      This format is not appropriate for data containing variables with unequal lengths since it will not generate consistent columns for the data fields. Use either the space delimited or comma delimited file for that case.

    Other spreadsheets will typically have similar options. However, the details may vary depending on the specific spreadsheet program.

    Note that directly exporting the Excel data to an ASCII file tends to work well when the data sheet is "clean". That, is you basically have a single rectangular set of data cells. If your spreadsheet contains graphs or multiple rectangular areas of data, then the generated ASCII file will tend to be difficult to work with. In this case, it is recommended that you either copy the relevant data to a clean sheet or paste it into an ASCII editor (e.g., Notepad or Wordpad) and save the file from there.

    The next section discusses cut and paste within Dataplot. In many cases, this may provide the simplest way to retrieve data from a spreadsheet.

    CUT AND PASTE

    In some contexts, it may be desirable to simply cut and paste relevant data into Dataplot. For example, this can provide an alternative way to import data from spreadsheets and other statistical software.

    How well cut and paste works is dependent on the operating system and the compiler used to build Dataplot. If you do this, we recommend limiting it to the case of numeric data.

    Some specific cases are

    1. Linux systems with the gfortran compiler

      As an example, suppose that the system clipboard contains three columns of data. You can then do something like

        READ Y X1 X2
        <paste the contents of the clipboard>
        END OF DATA

      That is, you do a terminal read, paste your data, and then enter an END OF DATA command to terminate the READ.

    2. Windows systems with the Intel compiler

      For earlier versions of the compiler, the operations described for Linux/gfortran worked for this environment as well. However, for the version of the compiler currently being used, this is no longer working. Some testing has shown that it works for one or two lines, but Dataplot crashes for more than that. We are investigating this to see if we can get it working again.

    3. Tcl/Tk GUI

      The spreadsheet in the Dataplot Tcl/Tk GUI does not accept paste operations in the data spreadsheet.

    Note: The 2014/12 version of Dataplot added numerous commands for reading from (and writing to) the clipboard. The initial implementation is for the Windows environments, although this should be extended to Linux and Mac OS X platforms in subsequent releases.

    COMMA AS DECIMAL POINT

    Dataplot follows the United States convention where the decimal point is the period ".". Some locales may use a different character to denote the decimal point. In particular, some countries use the comma ",".

    To allow Dataplot to read files that use a character other than the "." for the decimal point, enter the command

      SET DECIMAL POINT <value>

    where <value> denotes the character that specifies the decimal point.

    Note this support is fairly limited. Specifically, it applies to free-format reads (i.e., no SET READ FORMAT command has been entered). In addition,

    1. This option is not supported for the WRITE command. WRITE will always use a period for the decimal point.

    2. Dataplot alphanumeric output (e.g., the output from the FIT command) is generated with the period as the decimal point.

    3. As mentioned above, if you read your data with a SET READ FORMAT command, the data must use the period for the decimal point.

    MISSING VALUES AND UNDEFINED NUMBERS

    Some software programs will have special characters to denote missing values or undefined values (e.g., the result of trying to divide by 0).

    In particular, Unix/Linux software often uses "nan" to denote an undefined number. If Dataplot encounters an "nan" in a numeric field, it will convert it to the Dataplot "missing value". The "nan" search is not case sensitive (i.e., it will check for "NAN", "NaN", etc.). You can specify what Dataplot will use for the missing value by entering the command

      SET READ MISSING VALUE <value>

    where <value> is a numeric value.

    Missing value flags are specific to individual programs. You can specify a character string that denotes a missing value with the command

      SET DATA MISSING VALUE <value>

    where <value> is a string with 1 to 4 characters. If Dataplot encounters <value> in a numeric field, it will convert it to the Dataplot "missing value". The missing value string is not case sensitive. You can specify what Dataplot will use for the missing value by entering the command

      SET READ MISSING VALUE <value>

    where <value> is a numeric value.

Syntax 1:
    READ <x1> <x2> ... <xk>
    where <x1>, <x2>, ... <xk> are the desired names for the variables into which the data are read.

    This syntax is used to read from the terminal or from within a macro file. All lines are read until an END OF DATA is encountered.

Syntax 2:
    READ <file> <x1> <x2> <x3> etc.
    where <file> is the name of the mass storage file where the data resides;
    and <x1>, <x2>, ... <xk> are the desired names for the variables into which the data in <file> are read.

    This syntax is used to read from a file. All lines are read until an END OF DATA or the physical end of file is encountered.

Examples:
    READ CALIB. PRES TEMP TIME
    READ ASTM.DAT Y1 Y2 Y3 X DAY LAB
    READ Y1 Y2 Y3 X DAY LAB
Note:
    By default, Dataplot peforms free format reads. However, it has the capability for supporting Fortran style formats. Formatted reads can be about 10 times faster on many systems which can be helpful for large data files. Enter HELP READ FORMAT for more details.

    Note that Fortran formats are based on the decimal point lining up consistenly between rows. Spreadsheet programs such as Excel tend to generate either right justified or left justified columns when generating fixed width ASCII files. These are typically not consistent with Fortran formatted reads.

Note:
    Blank lines in data files are ignored.
Note:
    In order to determine whether the first argument is a file name or a variable name, it looks for a period in the name. If it finds one, it assumes a file name. If it does not, it assumes a variable name. If your file name does not contain a period, attach a trailing period (no spaces) to the file name on the READ command.
Note:
    Dataplot does not assume specific extensions for file names. Although using conventions (e.g., ".DAT" or ".TXT" for data files, ".DP" for Dataplot macros) can be helpful for distinguishing between types of files, this is more for the analysts convenience. Dataplot itself does not enforce any conventions.

    File names have the following restrictions:

    1. The file name should be a valid file name for the local operating system.

    2. The file name should contain a period "." in the file name itself or as a trailing character. Dataplot strips off trailing periods on those systems where it is appropriate to do so. On systems where trailing periods can be a valid file name (e.g., Unix), Dataplot tries to open the file with the trailing period. If this fails, it then tries to open the file with the trailing period stripped off.

    3. If the file name contains spaces or hyphens, then it needs to be enclosed in quotes.

    4. File names are currently limited to 80 characters. This can in particular be a problem if the file name is contained within a long path name. The following can be helpful in these cases.

      • You can use the CD command to make the path where the file is stored the current directory. This is most useful for data files. For example,

        pwd
        cd <path where data file resided>
        read file.dat ...
        cd ^CURDIR

        The pwd command is used to save the current directory. The cd command is then used to set the current directory to the path where the data resides, the read is performed, and then the cd command is used to restore the original working directory (the cd command saves the current path in the string CURDIR).

      • You can use the SEARCH DIRECTORY command to specify an additional directory to search for file names.
Note:
    File names are case sensitive on Unix/Linux/Mac OS X systems. For these systems, Dataplot attempts to open the file as given. If this fails, it attempts to open the file as all upper case characters. If this fails, it attempts to open the file as all lower case characters. As a further caution for Unix/Linux hosts, certain expansion characters (specifically ~ to refer to your home directory) are interpreted by the shell and are not recognized by the Fortran compiler. These expansion characters are interpreted as literal characters and do not yield the intended file name.
Note:
    In general, Dataplot does not read binary data. However, it can read and write binary data using Fortran unformatted I/O. Note that although the Fortran standard includes unformatted I/O, the implementation details are left to the individual compiler. This means that Fortran unformatted files are not portable across systems and compilers.

    The primary use for this option is if you have a large data file that you will be accessing frequently. In this case, it can speed up the I/O to save a binary version of the file (you should keep the original ASCII version).

    For details, enter HELP SET READ FORMAT.

Note:
    Many data sets are now collected as images. On some implementations, Dataplot can use the GD library to read image data into numeric arrays.

    Although the GD library supports a limited number of image formats, open source software packages such as Image Magick and Netpbm can be used to convert a large number of image formats to ones supported by the GD library.

    For details, enter HELP READ IMAGE.

Note:
    There are variants of this command for reading matrices, parameters, and strings/functions. See the Related Commands section below.
Note:
    After a READ command, Dataplot creates the following parameters:

    ISKIP   the number of header lines skipped
    NUMLRD   the number of data lines read
    NUMVRD   the number of variables read

    In addition, the variable names read are saved in the strings ZZZV1, ZZZV2, ZZZV3, and so on. These parameters and strings are updated each time a READ is performed.

    This capability was added 2014/12.

Default:
    1. If no file name is specified and a CALL is being executed, then the data values should be listed directly in the DATAPLOT sub-program immediately after the READ command (do not forget the END OF DATA statement).

    2. If no file name is specified and the commands are being manually entered/executed one at a time from the terminal, then the data should be entered directly from the terminal immediately after the READ command (also terminated by an END OF DATA statement).
Synonyms:
    None
Related Commands: Applications:
    Data Input
Implementation Date:
    Pre-1987
    1988/02 Ignore column limits when reading from the terminal
    1990/05 Check for comment character in data files
    1995/04 Support for unformatted read
    1996/04 Ignore SET READ FORMAT for READ STRING
    1997/10 Support for SKIP AUTOMATIC
    1998/11 Support for more than 100 variable names
    1999/12 Support for READ ROWID
    2002/07 Support for quotes on file name
    2003/02 Maximum number of characters per record user settable
    2004/01 Support for reading variable names from file
    2004/01 Support for reading character data
    2004/11 PACK/DISPERSE options for READ with SUBSET
    2014/11 Support for reading from system clipboard
    2014/12 Create several automatic parameters/strings for READ
    Numerous bug fixes over the years
Program:
     
    SKIP 25
    READ BERGER1.DAT Y X BATCH
        

Privacy Policy/Security Notice
Disclaimer | FOIA

NIST is an agency of the U.S. Commerce Department.

Date created: 10/29/2014
Last updated: 01/28/2015

Please email comments on this WWW page to alan.heckert.gov.