SQLite Forum

Better download file naming
Login
What you read as my "tone" is yet another attempt<sup><b>1</b></sup> to get past your insistence upon a single way to solve your problem<sup><b>2</b></sup> and understand what the solution constraints are. Richard spent some of his valuable time trying to help solve it. Given that the new HTML comment product table was not going to help you, as now generated, I thought that a reordering of fields or some extra field might well suffice. But I am unwilling to blindly stab at revisions to it. Hence my repeated effort to get at the actual constraints. You should not be surprised or offended that such efforts became increasingly explicit and again included dissuasion of yet another response resembling "If only the URL was formed as ...".

For what it's worth, to you or others with a similar issue, here is a Perl script which filters the download page content so as to yield the URL and version of a particular downloadable SQLite utility archive:<code>
  while ($_ = <>) {
    if (my ($urlfrag, $version) = m/^PRODUCT,(\\d+\\/sqlite-tools-win32-x86-\\d+\\.zip),(3\\.[\\d\\.]+),/) {
      printf("URL: https://sqlite.org/%s , Version: %s\n", $urlfrag, $version);
    }
  }
</code>

Piping the output of<code>
  wget -O - https://sqlite.org/download.html 2>nul
</code>through that filter will emit the download URL and object version.

As far as I can tell, absent better information, this "solution" has only one shortfall as far as its regular expression is concerned: The two data items are in the wrong order for one particularly limited consumer. If that was the only shortfall, I would check in a revision of that HTML table generator today to put the fields in a more palatable order.

I have deferred documenting that HTML comment table structure because I thought it might evolve in response to suggestions from you and others. We already have [one helpful suggestion from Doug](https://sqlite.org/forum/forumpost/475d3c6dc57156d1?t=h). If we can get past attitude problems here, there may be other useful changes.

----
1. Previous, unsuccessful attempts can be seen in posts 7 and 11. 

2. We presume that others may have similar issues, so the problem is not strictly "yours".