Because I want to search via my webserver, I have a separate PHP script that 
does the search.  Probably not as fast as MongoDB.  I do get good cohesive 
reports though.  I get a report for example that will show me just one of my 
QSO's, and will store results in a text file.  That makes it useful to refer to 
later, or to include in an email to my QSO partner.

All that said I would like to explore MongoDB.  The idea that query via js 
script may mean that I can still have private web access.  I use IIS on Win10 
and just the local machine can access it.

__________
Dan – K4SHQ


-----Original Message-----
From: Greg Beam [mailto:ki7m...@gmail.com] 
Sent: Monday, July 1, 2019 3:47 PM
To: wsjt-devel@lists.sourceforge.net
Subject: Re: [wsjt-devel] ALL.TXT (again)

Hello All,

Here's an example from today's log:

Results: https://paste.ubuntu.com/p/382VVMth4S/

The query takes about (2) seconds or so using a $regex search on
7,390,224 logged events matching two callsigns; this is without being indexed 
nor field splitting. It is one string per line imported to a one field document 
in MongDB

I can post the script I used as a gist, if anyone is interested:

- Copies the ALL.TXT to $temp_file
- Converts it to CSV
- Generates two helper JS scripts
- Generates one example JS query
- Drops, then re-imports the alltext collection
- Runs the a sample Query.

Note: for incremental (daily) updates, there is no need to drop the collection 
(alltext) before inserting new events. I just do that for performance testing.

It's a simple one-line query command that would work on Win/Linux/Mac:

mongo < example.js

You can, if desired, write any number of commands to perform stats, lookup(s), 
whatever, and use the same easy method to query the DB. 
However, as this is a single sting entry, much of the analytical value would be 
missing, as the fields / categories are not captured.

73's
Greg, KI7MT



On 7/1/19 1:27 AM, Claude Frantz wrote:
> On 7/1/19 7:59 AM, Claude Frantz wrote:
> 
> Just as an example of code extract in perl:
> 
> if ($line =~ m/^(\d{4})-([A-Z][a-z]{2})-(\d{2})\b/ ) {
>      $day = $3 ;
>      $month_alpha = $2 ;
>      $year = $1 ;
> }
> elsif ($line =~ m/^(\d\d)(\d\d)(\d\d)_\d{6}\b/ ) {
>      $day = $3 ;
>      $month_num = $2 ;
>      $year = 2000 + $1 ;
> }
> elsif ($line =~ m/^(\d{4})-(\d\d)-(\d\d)\b/ ) {
>      $day = $3 ;
>      $month_num = $2 ;
>      $year = $1 ;
>      }
> 
> I have not tested it, I hope there is no error. This allow to decode 
> the
> 3 formats of ALL.TXT about which ones I remember about. Please note 
> that the month can be numeric or alpha. If alpha, you have to convert 
> to numeric, if you want to compare to a numeric value. Please note 
> also, that the mode switching was an extra line in previous formats.
> 
> Best wishes,
> Claude (DJ0OT)
> 
> 
> _______________________________________________
> wsjt-devel mailing list
> 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


_______________________________________________
wsjt-devel mailing list
wsjt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wsjt-devel

Reply via email to