User:Timeshifter/Sandbox

From Wikipedia, the free encyclopedia

Thanks again. I messed up the last file I uploaded. Counts and rates were both in the value column. Sorry.

Here is link to a new file:

It is filtered for firearms and rates. I also removed all the regions. I hadn't noticed them at the end. I also removed all the commas.

I labeled the headers as Location, Year, and Value. Can you give me the gawk code for it, and the result? That way I may be able to use it as a more general solution. Does the order of the columns matter? Or does the gawk code depend solely on the column header name?

I noticed the spam filter got me. I work on several wikis, and have set up spam filters myself. So I understand. Maybe they can put wikipedia and wikimedia on the spam whitelist. Wikimedia is nonprofit, and is in the top ten of visited websites:

  • See Wikipedia: "List of most-visited websites"

So Wikimedia doesn't need any help to become more popular, and should not be considered spam here. Libreoffice Calc is mentioned many times in the many Help:Table pages. I am a donor to Libreoffice (though not with the alias email address I use to log in here and elsewhere to avoid problems). Others may have tried to ask questions here about Wikipedia tables, etc., and given up if they got hit with the spam filter. The filter message doesn't say what URL is the problem. I had no idea since I had left data source URLs too. Reminds me of those annoying Facebook post deletions that don't tell what post was deleted, or why. I only have one other thread in this forum. It is from 2021, and is about another Wikipedia list article that also happens to use a UNODC data source. So I guess the duplication is what initiated the spam filter. The other forum thread was much more complicated. I was never able to use it elsewhere since it is so complicated, and since I only regularly use very basic Calc functions. But I am very skilled with Wikipedia tables, and have written large parts of the various Help:Table pages.

So I hope to add some basic gawk info to the Help:Table pages.

About gawk, I would like to be able to copy the latest gawk code from this thread, and use it. But I have no clue how to use it. What would be the simplest way? Let's say I have another 3-column file with Location, Year, and Value. And want only the latest year for each country, state, province, region, or whatever location is in the file.

I got this notice: "Sorry you cannot post a link to that host." I removed the Wikipedia link, and then got this message: "Sorry, new users can only put 2 links in a post." I now have only one link. To the Google Drive location of the 1 MB file that the forum wouldn't let me upload while saying that 4 MB was the limit.