{
  "id": 14908922,
  "title": "Do not guess which CSV column contains the URL",
  "url": "https://urgent.news/2026/10/16/do-not-guess-which-csv-column-contains-the-url",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-16T08:30:59.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/agprolabs/do-not-guess-which-csv-column-contains-the-url-4e4l"
  },
  "original_language": "en",
  "account": "When importing data from a CSV file, the column containing the URLs can be located in either the first or second position, depending on the order of the headers. To ensure accurate parsing, developers must write a function that accepts a header array and returns the indices of the \"url\" and \"title\" columns. This function should validate the header length, trim whitespace, and reject any duplicate, missing, or extra columns. The function should also handle cases with leading BOM characters and quoted fields containing commas. By following these guidelines and testing with various header configurations, developers can reliably extract URLs from CSV files without guessing the correct column position.",
  "summary": "A resource importer can parse a CSV successfully and still read the wrong column. If the file changes from url,title to title,url , a hard-coded row[0] silently turns a display title into a destination. Here is a small contract for a two-column application format . It accepts either column order, trims header whitespace (including a leading BOM), and requires the exact, case-sensitive names url…",
  "key_points": [
    "CSV column with URLs can be first or second",
    "Function needed to identify URL and title columns",
    "Validate header, handle BOM and quoted fields"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}