Log in / create account Article Discussion Edit History Go to the site toolbox

Code

From Reporting Cookbook: www.forjournalists.com/cookbook

Got a nifty piece of code that helps get a repetitive task done? Share it here.

The wiki software doesn't play well with programming code. Here is an explanation of how to format it so it looks nice.


Contents

[edit] Perl Scripts

[edit] Python Scripts

  • College Football Penalty Finder: A script that goes to ESPN's play-by-play logs, finds and extracts information on penalties by a particular team.
  • ZIP Code Finder: A script to use the Google geocoder to find ZIP codes for a file of addresses.
  • Election Results Scraper: A script that goes to USA Today's election results pages and pulls out the county by county results for each state.
  • Concatenate files: A script that takes a bunch of files of the same type (has to be txt or some kind of markup, like html, xml, etc.) and mushes them together into one big file. Good for quick db-building.
  • Combine spreadsheets: A script to combine multiple Excel spreadsheets into a single delimited file.
  • Itemizer: A script to create a two-column table of key-value pairs from datasets where rows contains a unique identifier and varying numbers of additional fields.
  • Padding text files: A script that you can easily modify to pad fixed-width text files to make them easier to import into a database manager.

[edit] VBA Code

  • VBA grouped medians: An Excel function that calculates medians from grouped frequency distributions.

[edit] Firefox

[edit] SQL

  • UDFs

Site Toolbox:

Attribution-Noncommercial-Share Alike 3.0 Unported
This page was last modified 19:26, 25 March 2009. - This page has been accessed 3,236 times. - Disclaimers - About Reporting Cookbook