{
  "id": "1994-june-fixing-data-in-foxpro",
  "slug": "1994-june-fixing-data-in-foxpro",
  "url": "https://dwillis.github.io/uplink/article/1994-june-fixing-data-in-foxpro.html",
  "year": 1994,
  "month": "June",
  "monthNum": 6,
  "headline": "Fixing data in FoxPro",
  "kicker": "Tech Tips",
  "author_name": "Richard Mullins",
  "author_title": "",
  "affiliation": "University of Missouri",
  "summary": "This article explains how to use FoxPro commands like REPLACE and STRTRAN to standardize and clean up data fields such as addresses and city names, removing inconsistencies like periods and inconsistent capitalization.",
  "keywords": [
    "FoxPro",
    "database",
    "standardization"
  ],
  "topics": [
    "Data & Databases",
    "Investigative Methods",
    "Technology"
  ],
  "technologies": [
    "FoxPro",
    "SQL",
    "XBase"
  ],
  "full_text": "When you're cleaning up data or making names, addresses, and other details consistent, some changes can be done on a field as a whole. For example, if the city field has \"St. Louis\" or \"Saint Lewis\" you can issue a command to change it to \"ST LOUIS\" in every case. The SQL command for this is UPDATE. FoxPro, while it supports SQL, does not include the UPDATE command, since the XBase command language that FoxPro also uses already had an equivalent command for UPDATE. In FoxPro, the command for this task is:\n\nREPLACE ALL city WITH \"ST LOUIS\";\nFOR city = \"St. Louis\" OR city = \"Saint Lewis\"\n\nThe FoxPro command words are capitalized in this example for clarity. The semicolon allows you to continue the command to the next line.\n\nYou'll notice that not only did this example fix a gross misspelling and standardize on the abbreviation for \"Saint,\" it also capitalized every letter and got rid of the period in the abbreviation. Both of these steps are good standards for address information and are used by the Federal Election Commission and the Postal Service.\n\nTo carry out this standard of no periods in an address field, we need a command to search and replace inside a field. Here's the FoxPro command:\n\nREPLACE ALL address WITH STRTRAN (address, )\n\nThe STRTRAN() function does the work inside the fields. The syntax for STRTRAN() looks like this:\n\nSTRTRAN <FieldName>, <SearchFor>, <ReplaceWith>)\n\nThe function takes its working instructions from the stuff you put inside the parentheses. The computer word for \"stuff inside the parentheses\" is \"arguments.\" The first argument says \"Here's where to do the work.\" A comma signals the second argument, which says \"Look for this string of characters.\" The third argument says \"Replace all the strings with this string.\" If the third argument is missing, then the search string is replaced with nothing. In this case, the periods are removed and nothing is put in their place. Here's a before-and-after picture:\n23 Elm St. N.W.\n23 Elm St NW\nTo capitalize everything in the address field:\nREPLACE ALL address with UPPER (address)\nMullins can be reached at Jourram@muccmail.missouri.edu.",
  "provenance": {
    "extracted_by": "anthropic/claude-sonnet-4-6",
    "extracted_at": "2026-07-05",
    "verified": true
  },
  "similar": [
    {
      "slug": "1998-april-foxpro-to-access-and-back-again",
      "score": 0.283
    },
    {
      "slug": "1997-january-use-foxpro-to-document-a-table",
      "score": 0.26
    },
    {
      "slug": "1997-may-cheating-at-foxpro",
      "score": 0.248
    },
    {
      "slug": "1996-august-switching-from-foxpro-to-access",
      "score": 0.241
    },
    {
      "slug": "1997-july-the-data-they-are-a-changin",
      "score": 0.229
    }
  ],
  "html_url": "https://dwillis.github.io/uplink/article/1994-june-fixing-data-in-foxpro.html",
  "json_url": "https://dwillis.github.io/uplink/article/1994-june-fixing-data-in-foxpro.json"
}