Gmtselect with extra columns of mixed type, but starting with a numeral

I found a couple of other topics in the forum that were similar to this one, but not quite describing the same situation I’m facing.

I have a file that consists of four columns, looking like this (first few sample lines):

-121.755 35.5604 51445 320000N1140000W001
-117.106 32.545 25067 325450N1171061W001
-117.106 32.545 25068 325450N1171061W002
-117.106 32.545 39833 325450N1171061W003
-117.106 32.545 25069 325450N1171061W004
-117.106 32.545 38479 325450N1171061W005
-117.088 32.5493 35592 325493N1170884W001
-117.061 32.5536 48699 325536N1170608W001
-117.063 32.5538 20460 325538N1170626W001
-117.063 32.5538 35590 325538N1170626W002

So, cols 0-3 are: lon, lat, a numeric ID and an additional mixed ID (looks like it consists of a format of: lat_N_lon_W_count).

I’d like to use gmtselect to select specific records that fall inside a closed boundary (using the -F option), and have it retain all four columns, including the mixed ID.

Based on other threads, I also tried a variety of combinations of the -i option (-i0-3,t, -i0-2,t, -i0-1,2-3t, etc), to no avail. The best I’ve been able to do is have col 3 get returned with NaN values. The documentation is just not quite sufficient for clear guidance.

Any better directions are most welcome! Thanks.

I tested a few lines (t.txt) and ran this and seems to work?

gmt select -R-120/-115/30/50 t.txt
-117.106 32.545 25067 325450N1171061W001
-117.106 32.545 25068 325450N1171061W002

Yes, I found the same, too. The -R option works fine, but -F with a closed polygon failed, at least for me.

Let me see whether I can create a small data set to test it with. I’ll upload, if I can create such a thing that fails!

I also met the same situation with @John_Geodesy. When using the OGR_GMT file as a polygon filter, only the first N columns were output (the N+1th column were non-numerical ) . I guess the bug is related to OGR_GMT format parsing. Because when I remove the OGR_GMT file header, sth. like “# @VGMT1.0 @GPOLYGON” , all records can be output correctly.