1GMTCONVERT(1)                Generic Mapping Tools               GMTCONVERT(1)
2
3
4

NAME

6       gmtconvert  -  Converts, Pastes, and/or Extracts columns from ASCII and
7       binary 1-D tables
8

SYNOPSIS

10       gmtconvert [ inputfiles ] [ -A ] [ -D[template] ] [ -E[f|l] ] [  -Fcols
11       ]  [  -H[i][nrec]  ] [ -L ] [ -I ] [ -M[i|o][flag] ] [ -N ] [ -S"search
12       string") ] [ -V ] [ -:[i|o] ] [ -b[i|o][s|S|d|D[ncol]|c[var1/...]] ]  [
13       -f[i|o]colinfo ]
14

DESCRIPTION

16       gmtconvert  reads its standard input [or inputfiles] and writes out the
17       desired information to standard output.  It can  do  a  combination  of
18       three  things:  (1)  convert  between binary and ASCII data tables, (2)
19       paste corresponding records from multiple files into a single file, (3)
20       extract a subset of the columns, (4) only extract segments whose header
21       matches a text pattern search, (5) just list all  multisegment  headers
22       and  no  data  records,  and (6) extract first and last data record for
23       each segment.  Input (and hence output) may have multiple subheaders if
24       -M is selected, and ASCII tables may have regular headers as well.
25
26       datafile(s)
27              ASCII (or binary, see -bi) file(s) holding a number of data col‐
28              umns.
29

OPTIONS

31       -A     The records from the input files should be pasted  horizontally,
32              not  appended  vertically.   [Default  processes one file at the
33              time].  Note for binary input, all the files you want  to  paste
34              must have the same number of columns (as set with -bi).
35
36       -D     For  multiple segment data, dump each segment to a separate out‐
37              put file [Default writes a multiple  segment  file  to  stdout].
38              Append  a  format  template  for the individual file names; this
39              template must contain a C format specifier that  can  format  an
40              integer  argument  (the  segment number); this is usually %d but
41              could be %8.8d which gives leading zeros, etc. [Default is  gmt‐
42              convert_segment_%d.d].
43
44       -E     Only  extract  the  first  and  last  record for each segment of
45              interest [Default extracts all records].  Optionally,  append  f
46              or  l  to only extract the first or last record of each segment,
47              respectively.
48
49       -F     Give a comma-separated list of desired columns or ranges  (0  is
50              first column) [Default outputs all columns].
51
52       -H     Input  file(s)  has  Header record(s).  Number of header records
53              can be changed by editing your .gmtdefaults4 file.  If used, GMT
54              default  is  1  header record. Use -Hi if only input data should
55              have header records [Default will write out  header  records  if
56              the input data have them]. Blank lines and lines starting with #
57              are always skipped.
58
59       -I     Invert the order of rows, i.e.,  output  the  final  records  in
60              reverse  order,  starting  with  the last and ending up with the
61              first input row [Default goes forward].
62
63       -L     Only output a listing of all multisegment header records and  no
64              data records (requires -M and ASCII data).
65
66       -M     Multiple  segment  file(s).  Segments are separated by a special
67              record.  For ASCII  files  the  first  character  must  be  flag
68              [Default  is  '>'].  For binary files all fields must be NaN and
69              -b must set the number of output columns explicitly.  By default
70              the  -M  setting  applies to both input and output.  Use -Mi and
71              -Mo to give separate settings.
72
73       -N     Do not write records that  only  contain  NaNs  in  every  field
74              [Default writes all records].
75
76       -S     Only  output  those  segments  whose  header record contains the
77              specified text string [Default output all segments].
78
79       -V     Selects verbose mode, which will send progress reports to stderr
80              [Default runs "silently"].
81
82       -:     Toggles  between  (longitude,latitude)  and (latitude,longitude)
83              input and/or output.  [Default is (longitude,latitude)].  Append
84              i  to  select  input  only or o to select output only.  [Default
85              affects both].
86
87       -bi    Selects binary input.  Append s for single precision [Default is
88              d  (double)].   Uppercase  S  or  D  will  force  byte-swapping.
89              Optionally, append ncol, the number of columns  in  your  binary
90              input  file if it exceeds the columns needed by the program.  Or
91              append c  if  the  input  file  is  netCDF.  Optionally,  append
92              var1/var2/... to specify the variables to be read.
93
94       -bo    Selects  binary  output.  Append s for single precision [Default
95              is d (double)].  Uppercase S  or  D  will  force  byte-swapping.
96              Optionally,  append  ncol, the number of desired columns in your
97              binary output file.  [Default is same as input].
98
99       -f     Special formatting of input and/or output columns (time or  geo‐
100              graphical  data).   Specify  i  or  o to make this apply only to
101              input or output [Default applies to both].   Give  one  or  more
102              columns (or column ranges) separated by commas.  Append T (abso‐
103              lute calendar time), t (relative time in chosen TIME_UNIT  since
104              TIME_EPOCH),  x (longitude), y (latitude), or f (floating point)
105              to each column or column range item.  Shorthand  -f[i|o]g  means
106              -f[i|o]0x,1y (geographic coordinates).
107

ASCII FORMAT PRECISION

109       The ASCII output formats of numerical data are controlled by parameters
110       in your .gmtdefaults4  file.   Longitude  and  latitude  are  formatted
111       according  to  OUTPUT_DEGREE_FORMAT, whereas other values are formatted
112       according to D_FORMAT.  Be aware that the format in effect can lead  to
113       loss  of  precision  in  the output, which can lead to various problems
114       downstream.  If you find the output is not written with  enough  preci‐
115       sion, consider switching to binary output (-bo if available) or specify
116       more decimals using the D_FORMAT setting.
117

EXAMPLES

119       To convert the binary file test.b (single precision) with 4 columns  to
120       ASCII:
121
122       gmtconvert test.b -bis4 > test.dat
123
124       To  convert  the multiple segment ASCII table test.d to a double preci‐
125       sion binary file:
126
127       gmtconvert test.d -M -bo > test.b
128
129       You have an ASCII table with 6 columns and you want to  plot  column  5
130       versus column 0.  Try
131
132       gmtconvert table.d -F5,0 | psxy ...
133
134       If  the  file  instead is the binary file results.b which has 9 single-
135       precision values per record, we extract the last column and columns 4-6
136       and write ASCII with the command
137
138       gmtconvert results.b -F8,4-6 -bi9s | psxy ...
139
140       You  want  to  plot the 2nd column of a 2-column file left.d versus the
141       first column of a file right.d:
142
143       gmtconvert left.d right.d -A -F1,2 | psxy ...
144
145       To extract all segments in the file big_file.d  whose  headers  contain
146       the string "RIDGE AXIS", try
147
148       gmtconvert big_file.d -M -S"RIDGE AXIS" > subset.d
149

SEE ALSO

151       GMT(1), minmax(1)
152
153
154
155GMT 4.3.1                         15 May 2008                    GMTCONVERT(1)
Impressum