# Gmtselect - selecting on time

**URL:** <https://forum.generic-mapping-tools.org/t/gmtselect-selecting-on-time/1824>\
**Category:** Q&A\
**Created:** [June 24, 2021, 4:57pm UTC](https://forum.generic-mapping-tools.org/t/gmtselect-selecting-on-time/1824 "2021-06-24T16:57:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Geodesy](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john_geodesy/32/116_2.png) [@John\_Geodesy](https://forum.generic-mapping-tools.org/u/John_Geodesy)\
**Post date:** [June 24, 2021, 4:57pm UTC](https://forum.generic-mapping-tools.org/t/gmtselect-selecting-on-time/1824/1 "2021-06-24T16:57:15Z")

</div>

I have a file consisting of three columns.

Col 0 has: date&time (in format yyyy-mm-ddThh:mm:ss.s)  
Col 1 has lon  
Col2 has lat.

Can the gmtselect command select data for a specific time range?

It would be useful if something like this could be used:

```
gmt gmtselect infile.txt -f0T,1x,2y -Z2019-08-18T02:51:00/2019-08-18T02:53:00+c0 > outfile.txt

```

Nothing is produced when the above command is used. Maybe I’m specifying it incorrectly?

Here are ten lines of my file to play with.

```
2019-09-18T02:50:30.0000019200 -141.847794 78.889200
2019-09-18T02:51:00.0000000000 -141.847794 78.889178
2019-09-18T02:51:29.9999980800 -141.847791 78.889157
2019-09-18T02:51:59.9999961600 -141.847788 78.889136
2019-09-18T02:52:30.0000028800 -141.847785 78.889115
2019-09-18T02:53:00.0000009600 -141.847781 78.889093
2019-09-18T02:53:29.9999990400 -141.847777 78.889072
2019-09-18T02:53:59.9999971200 -141.847772 78.889051
2019-09-18T02:54:30.0000038400 -141.847767 78.889030
2019-09-18T02:55:00.0000019200 -141.847762 78.889008
```

---

<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:** [June 24, 2021, 9:11pm UTC](https://forum.generic-mapping-tools.org/t/gmtselect-selecting-on-time/1824/2 "2021-06-24T21:11:06Z")

</div>

Works for me but only after changing August to September in your -Z args. Also, note that -qi is the new way to do this as it is is a common option and available via all table-reading modules.

---

<div class="post-metadata">

**Author:** ![John\_Geodesy](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john_geodesy/32/116_2.png) [@John\_Geodesy](https://forum.generic-mapping-tools.org/u/John_Geodesy)\
**Post date:** [June 24, 2021, 9:24pm UTC](https://forum.generic-mapping-tools.org/t/gmtselect-selecting-on-time/1824/3 "2021-06-24T21:24:16Z")

</div>

Bad eyes! Can’t tell the difference between an 8 and a 9! But thanks for the tip about -qi.
