U.S. flag

An official website of the United States government

Video tutorial: Convert data files to CSV format

CSV (Comma Separated Values) is the preferred format for most data in the Ag Data Commons. Not only is a dataset more versatile as a CSV, but viewers can take advantage of built-in features like data visualizations and previews with CSV data files.

  • If your database can output data as CSV, opt for that choice to create your data file.
  • If you have an Excel spreadsheet and want to convert it to CSV, follow these steps:
    1. Make sure there is a single column header row to label your variables. If your current data has more than one header row, consider combining these into one row in a way that makes sense.
    2. Combine your data onto a single spreadsheet page. Delete any additional pages by right-clicking the blank pages at the bottom of your spreadsheet and choosing "Delete". Note that one multi-tab spreadsheet might become several CSV files.
    3. In order to use the built-in chart previews, remove any special characters from your column header rows. Some characters in the column headers prevent the embed / link features from working with charts and graphs in the Ag Data Commons. This step is not necessary to create a CSV, but is necessary to use the Embed feature for sharing your data visualizations created in the Ag Data Commons. This is a list of incompatible and acceptable special characters.
    4. Characters that should NOT be used in column headers for full compatibility with built-in data visualizations:

      Character | Description
      ` = accent
      ! = exclamation point
      @ = "at" symbol
      # = number / hashtag symbol
      $ = dollar symbol
      % = percent symbol
      ^ = caret
      & = "and" symbol
      * = asterisk
      ( ) = parenthesis
      < > = greater / less than symbols
      ? = question mark
      [ ] = brackets
      { } = brackets
      | = pipe
      \ = back slash
      ' = apostrophe
      ~ = tilde

      Acceptable characters to use in column headers for full compatibility with built-in data visualizations:

      Character | Description
      / = forward slash
      . = period
      " = double quotes

    5. Remove any commas from your document. Because the delimiter is a comma, extra commas in your text can cause errors in interpreting the data.
    6. Save your document - choose "Save as: CSV (Comma delimited)
    7. Upload this document as a data resource on the Ag Data Commons, and check Grid, Graph, and Embed to take advantage of the full functionality of the Ag Data Commons data previews.
  • (Please note, data is not required to be in CSV format, but is highly recommended if compatible with your data)