Good point Mike. Right now I’m using the PHP regex function and “(\d{4})-(\d{2})-(\d{2})”. That worked until the format change. The function returns a T/F status and sticks the result into an array.
Claude recommended a regex '^\d{6}_\d{6}\b' to detect the new format. I think both will work. I’ll do some research to see which method would be quickest and to see if PHP has a ‘sscanf’ comparable function. I’ll have to use both for the time being as 2019’s ALL.TXT will have both formats. Thanks to both of you. __________ Dan – K4SHQ From: Black Michael [mailto:mdblac...@yahoo.com] Sent: Sunday, June 30, 2019 7:53 AM To: 'WSJT software development' <wsjt-devel@lists.sourceforge.net>; Dan Malcolm <k4...@outlook.com> Subject: Re: [wsjt-devel] ALL.TXT (again) This logic should work until the format changes in 2099 or so unless it's just allowed to roll over in which case it will still work. You just need to get the current yymm instead of a "saved" date. If the yymm changes that will allow you to track any idle period correctly. #include <stdio.h> #include <stdlib.h> int main(int nargs, char *argv[]) { int yymmsave = 0; char buf[256]; FILE *fp = fopen(argv[1], "r"); if (fp == NULL) { perror(argv[1]); exit(1); } while (fgets(buf, sizeof(buf), fp)) { int yymm, dd, time; int n = sscanf(buf, "%4d%2d_%6d", &yymm, &dd, &time); if (n == 3 && yymm != yymmsave) { printf("%04d\n", yymm); yymmsave = yymm; } } fclose(fp); } de Mike W9MDB On Saturday, June 29, 2019, 11:32:47 PM CDT, Dan Malcolm <k4...@outlook.com<mailto:k4...@outlook.com>> wrote: I’m thinking that if I know I’m in year ‘19’ and the month changes from ’02 to GT ‘02’ then I can count that as a month change. Not likely but I can envision where I wounn’t be on the air for a month or more. __________ Dan – K4SHQ From: Black Michael via wsjt-devel [mailto:wsjt-devel@lists.sourceforge.net] Sent: Saturday, June 29, 2019 10:39 PM To: wsjtx-devel <wsjt-devel@lists.sourceforge.net<mailto:wsjt-devel@lists.sourceforge.net>> Cc: Black Michael <mdblac...@yahoo.com<mailto:mdblac...@yahoo.com>> Subject: Re: [wsjt-devel] ALL.TXT (again) There's nothing special about the month rollover The format is YYMMDD so here's the Feb-Mar rollover in my file for example. 190228_235945 14.074 Rx FT8 -3 0.9 2255 WB4HMA HC2AO -11 190301_000000 14.074 Rx FT8 -13 0.9 2598 VE1DBM LU1JAO -08 de Mike W9MDB On Saturday, June 29, 2019, 09:35:19 PM CDT, Dan Malcolm <k4...@outlook.com<mailto:k4...@outlook.com>> wrote: I am aware that ALL.TXT data formatting changed in late February this year. I am trying to write a PHP program to split All.TXT in monthly text files. I have program that does this for 2018, but it only finds January and February of 2019. The problem is probably a format change. Can anyone help me find the first entry of the month format? Is it YYYYMMDD_”time”? or something similar? __________ Dan – K4SHQ _______________________________________________ wsjt-devel mailing list wsjt-devel@lists.sourceforge.net<mailto:wsjt-devel@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/wsjt-devel
_______________________________________________ wsjt-devel mailing list wsjt-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wsjt-devel