Bug #1116

gmt select -h -i -f -C

Added by Marcelo 3 months ago. Updated about 1 month ago.

Status:ClosedStart date:2017-06-20
Priority:NormalDue date:
Assignee:Paul% Done:

100%

Category:-
Target version:Candidate for next bugfix release
Affected version:5.x-svn Platform:Linux

Description

I get an unexpected result from gmt select:

echo "-90.303670 -0.742999" > c.txt
echo -e "header\n2011-01-02T00:33:30 18 272.000000 1.500000 54.638458 9.153466" | gmt select -h1 -i2,3,5,0 -f0x,1y,2f,3T -Cc.txt+d1200k
gmtselect: Syntax error -C option: c.txt does not have at least 2 columns with coordinates

without the header, it works:

echo "2011-01-02T00:33:30 18 272.000000 1.500000 54.638458 9.153466" | gmt select -i2,3,5,0 -f0x,1y,2f,3T -Cc.txt+d1200k
-88     1.5     9.153466        2011-01-02T00:33:30

with the header, without the -C option, it works:

echo -e "header\n2011-01-02T00:33:30 18 272.000000 1.500000 54.638458 9.153466" | gmt select -h1 -i2,3,5,0 -f0x,1y,2f,3T
# Command : gmtselect -h1 -i2,3,5,0 -f0x,1y,2f,3T
# header
-88     1.5     9.153466        2011-01-02T00:33:30

gmt4 works:

echo -e "header\n2011-01-02T00:33:30 18 272.000000 1.500000 54.638458 9.153466" | awk '{print $3,$4,$6,$1}' | gmtselect -H1 -f0x,1y,2f,3T -C1200/c.txt
   header
272.000000 1.500000 9.153466 2011-01-02T00:33:30

appears to affect all gmt5.

History

#1 Updated by Paul 3 months ago

  • Status changed from New to Resolved
  • Assignee set to Paul
  • Target version set to Candidate for next bugfix release
  • % Done changed from 0 to 100

Thanks, it is the same problem that we fixed w.r.t the -i option some time ago and I forgot that the exact same issue would affect -h. The secondary inputs cannot use -i or -h; these only apply to the primary input. Fixed in r18405.

#2 Updated by Paul about 1 month ago

  • Status changed from Resolved to Closed

Closed as fixed.

Also available in: Atom PDF