# Gmtselect issue with output columns (again!)

**URL:** <https://forum.generic-mapping-tools.org/t/gmtselect-issue-with-output-columns-again/732>\
**Category:** Q&A\
**Created:** [July 31, 2020, 3:59am UTC](https://forum.generic-mapping-tools.org/t/gmtselect-issue-with-output-columns-again/732 "2020-07-31T03:59:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RustyCuth](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@RustyCuth](https://forum.generic-mapping-tools.org/u/RustyCuth)\
**Post date:** [July 31, 2020, 3:59am UTC](https://forum.generic-mapping-tools.org/t/gmtselect-issue-with-output-columns-again/732/1 "2020-07-31T03:59:31Z")

</div>

Seems me and gmtselect just don’t get along!

Trying to specify input and output columns.

(File “point.txt” contains “150.0 40.0”)

> gmtselect \<\<END -Cpoint.txt+d100k -fg  
> 150.1 40.1 A  
> 150.2 40.1 B  
> END

Gives:

> 150.1 40.1 A  
> 150.2 40.1 B

(as expected)

> gmtselect \<\<END -Cpoint.txt+d100k -fg -o2,1,0  
> 150.1 40.1 A  
> 150.2 40.1 B  
> END

Gives:

> NaN 40.1 150.1  
> NaN 40.1 150.2

Why isn’t column 2 output?

Tried specifying it as input (just in case this is what is expected):

> gmtselect \<\<END -Cpoint.txt+d100k -fg -i0,1,2 -o2,1,0  
> 150.1 40.1 A  
> 150.2 40.1 B  
> END

Gives:

> NaN 40.1 150.1  
> NaN 40.1 150.2

Seems it only works when long/lat are the first two columns.  
Any idea what’s going on?  
R

---

<div class="post-metadata">

**Author:** ![RustyCuth](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@RustyCuth](https://forum.generic-mapping-tools.org/u/RustyCuth)\
**Post date:** [July 31, 2020, 4:03am UTC](https://forum.generic-mapping-tools.org/t/gmtselect-issue-with-output-columns-again/732/2 "2020-07-31T04:03:25Z")

</div>

OK. Just realised that it’s getting upset because the extra columns are text and not numbers.  
Why can’t it just pass the text columns?

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [July 31, 2020, 4:12am UTC](https://forum.generic-mapping-tools.org/t/gmtselect-issue-with-output-columns-again/732/3 "2020-07-31T04:12:08Z")

</div>

All numerical columns come first, follow by any trailing text. See [https://docs.generic-mapping-tools.org/dev/cookbook/options.html#input-columns-selection-the-i-option](https://docs.generic-mapping-tools.org/dev/cookbook/options.html#input-columns-selection-the-i-option)  
If you want text in the position of x and y then awk is your only option.
