Skip to content

Commit

Permalink
WHen given multiple tables, report line number of bad records in the …
Browse files Browse the repository at this point in the history
…offending file (#8259)

See this post on the Forum.  The problem was that the report statement used the total internal record counter (the only option if you cat may files in to a table reader) but if you give individual files on the command line we have a secondary counter that gets reset to 0 for each new file. Pretty sure we just forgot.
  • Loading branch information
PaulWessel authored Jan 5, 2024
1 parent eabde4f commit 241db2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gmt_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -3914,7 +3914,7 @@ GMT_LOCAL void *gmtio_ascii_input (struct GMT_CTRL *GMT, FILE *fp, uint64_t *n,
if (*n == GMT_MAX_COLUMNS) *n = n_ok; /* Update the number of expected fields */
if (gmt_M_rec_is_error (GMT))
GMT_Report (GMT->parent, GMT_MSG_WARNING, "Mismatch between actual (%d) and expected (%d) fields near line %" PRIu64 " in file %s\n",
col_no, *n, GMT->current.io.rec_no, GMT->current.io.filename[GMT_IN]);
col_no, *n, GMT->current.io.data_record_number_in_tbl[GMT_IN], GMT->current.io.filename[GMT_IN]);

if (GMT->current.setting.io_lonlat_toggle[GMT_IN] && col_no >= 2) {
gmt_M_double_swap (GMT->current.io.curr_rec[GMT_X], GMT->current.io.curr_rec[GMT_Y]); /* Got lat/lon instead of lon/lat */
Expand Down

0 comments on commit 241db2c

Please sign in to comment.