4.7 Standard Input or File, header records
Keywords: GMT_Docs

Next: 4.8 Verbose Operation Up: 4. General features Previous: 4.6 Usage messages, syntax- Contents Index

#
4.7 Standard Input or File, header records

Most of the programs which expect table data input can read either standard input or input in one or several files. These programs will try to read stdin unless you type the filename(s) on the command line without the above hyphens. (If the program sees a hyphen, it reads the next character as an instruction; if an argument begins without a hyphen, it tries to open this argument as a filename). This feature allows you to connect programs with pipes if you like. If your input is ASCII and has one or more header records, you must use the -H option (see Section 4.4.4). For binary table data no headers are allowed. ASCII files may in many cases also contain sub-headers separating data segments. These are called ``multi-segment files'' and requires a special option (typically -M); see Appendix B for complete documentation.

If filenames are given for reading, GMT programs will first look for them in the current directory. If the file is not found, the programs will look in three other directories pointed to by environmental parameters (if set). These are GMT_GRIDDIR, GMT_IMGDIR, and GMT_DATADIR, and they may be set by the user to point to directories that contain data sets of general use. Normally, the first directory will hold gridded data sets accessible via the supplemental program grdraster whereas the second will hold the binary Mercator data images accessible via the supplemental program img2grd; see Appendix A for information about these supplemental programs. The third directory may hold miscellaneous data sets such as lines, points, and text plotable directly with psxy or pstext. Data sets that the user finds are often needed may be placed in these directories, thus eliminating the need to specify a full path to the file. Program output is always written to the current directory unless a full path has been specified.

Next: 4.8 Verbose Operation Up: 4. General features Previous: 4.6 Usage messages, syntax- Contents Index