CSV, TXT, and GPX files

You can use data stored in a comma-separated values (CSV) text file (.csv) or data stored in a delimited text file (.txt) or GPS Exchange Format file (.gpx) in ArcGIS Online. The following list summarizes how you can use these files and provides links to instructions. The sections after the functionality list provide information on proper formatting and tips for using .csv, .txt, and .gpx files in your ArcGIS Online organization.

  • Add .csv, .txt, and .gpx files as items and share them so others can download the data.
  • Add a .csv file containing latitude and longitude coordinates from a local or network drive to Map Viewer, or add .csv, .txt, and .gpx files to Map Viewer Classic to draw features on the map for each row in the file. The file is stored in the map as a layer, and you can edit the properties of the layer that is created. For example, you can configure pop-ups, change symbols, set the visibility range, enable editing, and remove pop-ups.
  • Add a .csv file that doesn't contain location information to a map as a table. This is useful when you want to join nonspatial data—for example, property damage claims related to a recent tornado—to spatial data such as a ZIP codes layer using the Join Features analysis tool.When you add a .csv file without location information to Map Viewer, a table layer is published and added to the map.
  • If the .csv file is stored on a publicly accessible website, you can reference it from the map in Map Viewer or in Map Viewer Classic as a layer on the web. If the .csv file contains coordinate information, updates made to the .csv file on the web will appear in the map. If the .csv file contains address or place information, updates made to the .csv file on the web will not be reflected in the map.

.csv and .txt files

.csv and .txt files store information in plain text. The first row in the file defines the names for all subsequent fields. In .csv files and .txt files, fields can be separated with a comma, semicolon, or tab. Other separators are not supported.

As no data types are enforced in the file, ArcGIS Online relies on the field names and specific formatting in the fields to interpret the data type that should be applied.

The following sections contain information about supported data formats in .csv and .txt files, and what you need to consider when adding .csv and .txt files to a map.

Location fields in .csv and .txt files

To use .csv and .txt files in your organization, the file must include location fields. Location fields can contain coordinate, address, or place information. The first row in the file must contain the location field names. Addresses can be stored in one or more fields. Coordinates must be in two separate fields.

If the file contains coordinate fields, ArcGIS Online uses these fields to locate the features on the map. ArcGIS Online supports the following coordinate types:

  • longitude and latitude*
  • latitude and longitude*
  • Military Grid Reference System (MGRS)
  • United States National Grid (USNG)
*Latitude and longitude information must be in decimal degrees.

In Map Viewer Classic, if the coordinate information cannot be determined or if the file contains address or place information instead, you are prompted to review the location fields and change them if necessary. You are always prompted to review location files in Map Viewer and the Content page.

The following location fields are supported:

  • Latitude, Longitude
  • Lat, Long
  • Longitude83, Latitude83
  • Longdecdeg, Latdecdeg
  • Long_dd, Latdd
  • Lng
  • Y, X
  • Ycenter, Xcenter
  • Xcenter, Ycenter
  • Point-y, Point-x
  • Point-x, Point-y
  • MGRS
  • USNG
  • Address
  • City
  • State
  • ZIP

Date and time in .csv files

Date and time fields in .csv files are assumed to contain Universal Time Coordinated (UTC) date and time and stored as such. That's because the physical location of the server hosting the data can be anywhere in the world. The alternative of storing date and time in a local time zone leads to problems, especially if you, or the server hosting the data, move to another time zone.

Whenever the value of a date or time field is displayed, it is converted from UTC time into your local time. This is done by querying your computer for its time zone setting. For example, suppose your computer is set to Pacific time (United States and Canada). Pacific time is eight hours behind UTC except during daylight saving time—when UTC time is 10:00 a.m., it is 2:00 a.m. Pacific time.

When you publish a hosted feature layer from a .csv file, you can specify the time zone of the data. The specified time zone is used to mitigate the offset because ArcGIS Online assumes date and time data to be in UTC. For example, when a .csv file containing date fields is published with pacific time selected as the time zone, all date and time values in your .csv file will have eight or seven hours added as part of the conversion to UTC, depending on whether the date values fall within daylight savings time.

If the date fields in the .csv file contain a date but not a time value, a time value of midnight is assigned when you publish a hosted feature layer. Therefore, if you don't specify a time zone when you publish, the data will be stored with a time value of midnight (UTC). When you view the data, time will be converted to the local time, potentially changing the date. For example, 7/28/2009 0:00 is midnight (UTC) on July 28, 2009. If you view the data from a computer in the pacific time zone, the date and time will be displayed as 7/27/2009 17:00. Specifying the time zone when you publish eliminates this offset when viewed in the time zone specified.

The following table lists date and time formats that will result in a date field in the hosted feature layer that you publish from a .csv file.

Values in a format not in this list will be created as string data types in the resulting hosted feature layer, or, if only numerals are present, as an integer.

FormatExample

M/DD/YYYY

7/28/2009

M/DD/YYYY 12-hour time

7/28/2009 5:23 AM or 7/28/2009 05:23 AM

M/DD/YY

7/28/09

M/DD/YY 12-hour time

7/28/09 5:23 PM or 7/28/09 05:23 PM

MM/DD/YY

07/28/09

MM/DD/YY 12-hour time

07/28/09 5:23 PM or 07/28/09 05:23 PM

MM/DD/YYYY

07/28/2009

MM/DD/YYYY 12-hour time

07/28/2009 5:23 PM or 7/28/2009 05:23 PM

Month DD

July 28

YYYY/MM

2009/07

YYYY-MM

2009-07

YYYY/MM/DD

2009/07/28

YYYY-MM-DD

2009-07-28

YYYY/MM/DD hh:mm:ss

2009/07/28 17:23:00

YYYY-MM-DD hh:mm:ss

2009-07-28 17:23:00

YYYY/MM/DD hh:mm:ss.s

2009/07/28 17:23:00.0

YYYY-MM-DDThh:mm:ss.s

2009-07-28T17:23:00.0

If you add a .csv file directly to Map Viewer Classic, the following date formats are loaded as dates, but times do not appear in the table in Map Viewer Classic:

FormatExample inputTable value

M/DD/YYYY 12-hour time

7/28/2009 5:23 PM

July 28, 2009

MM/DD/YYYY 12-hour time

07/28/2009 5:23 PM

July 28, 2009

M/DD/YY 12-hour time

7/28/09 5:23 PM

July 28, 2009

MM/DD/YY 12-hour time

07/28/09 5:23 PM

July 28, 2009

If you add a .csv file directly to Map Viewer Classic, the following date formats are loaded as string fields exactly as they appear in the .csv file:

FormatExample input

M/DD/YYYY

7/28/2009

MM/DD/YYYY

07/28/2009

M/DD/YYYY 24-hour time

7/28/2009 17:23

MM/DD/YYYY 24-hour time

07/28/2009 17:23

M/DD/YY

7/28/09

MM/DD/YY

07/28/09

M/DD/YY 24-hour time

7/28/09 17:23

MM/DD/YY 24-hour time

07/28/09 17:23

Month DD

July 28

YYYY/MM

2009/07

YYYY-MM

2009-07

YYYY/MM/DD

2009/07/28

YYYY-MM-DD

2009-07-28

YYYY/MM/DD hh:mm:ss

2009/07/28 17:23:00

YYYY-MM-DD hh:mm:ss

2009-07-28 17:23:00

YYYY/MM/DD hh:mm:ss.s

2009/07/28 17:23:00.0

YYYY-MM-DD hh:mm:ss.s

2009-07-28 17:23:00.0

Considerations for publishing date fields in .csv files

Keep the following in mind when publishing date fields:

  • When you specify a time zone when you publish a .csv file, the selected time zone is applied to all date and time values that exist in the .csv file at the time you publish or when overwriting the feature layer.
  • If you want to apply a time zone only to individual records, you can specify an offset from UTC for the respective record. For example, if you had a date value of Tuesday, July 28, 2009 5:23 AM+8, that reflects a time zone that is eight hours ahead of UTC. See www.worldtimezone.com for a list of the world's time zones. When the time zone is specified per record in the .csv file, a time zone selected during publishing is applied to those records that do not have an offset specified.
  • If you specify a time zone when you publish a hosted feature layer from a .csv file, overwriting the hosted feature layer with updated data maintains the time zone you selected when you originally published.
  • If you alter date fields in the feature layer you published, including if you alter the hosted feature layer to use the Keep track of who created and last updated features option, the date fields capture values in the editor's local time and convert to UTC with the time offset applied.
  • When you export data from a hosted feature layer for which you specified a time zone when you published, no offset is applied. Data is exported in UTC format, which effectively maintains the time zone you selected when publishing.
  • Daylight saving time is automatically applied if a date value in your .csv file falls within daylight saving time and the selected time zone recognizes daylight saving time.

Date fields in .txt files

When you add a .txt file to Map Viewer Classic, the following date formats are recognized as date fields:

FormatExample inputTable value

M/DD/YYYY 12-hour time

7/28/2009 5:23 PM

July 28, 2009

MM/DD/YYYY 12-hour time

07/28/2009 5:23 PM

July 28, 2009

MM/DD/YY 12-hour time

07/28/09 5:23 PM

July 28, 2009

Day of week, Month DD, YYYY 12-hour time*

Tuesday, July 28, 2009 5:23 PM

July 28, 2009

Month DD, YYYY 12-hour time*

July 28, 2009 5:23 PM

July 28, 2009

*These date formats are only supported if you delimit fields using tabs or a semicolon.

Considerations for adding .csv and .txt files to a map

  • The more address fields you include, the more accurate the geocoding results will be. For example, address and ZIP code will yield better results than just address.
  • The address field can contain multiple parts of an address (sometimes called single-line geocoding).
  • Map Viewer Classic does not support a country field. By default, it geocodes addresses based on your organization's region. You can select a different country when you add the file. If the file contains addresses from multiple countries, select World.
  • When you add a .csv file directly to Map Viewer Classic, field types are set automatically and cannot be changed. If you need to change field types, publish your .csv file as a hosted feature layer and define the field types when you publish. When you add a .csv file to Map Viewer, you can define field types.
  • If the file contains more spaces than separators in the field names (the first line of the file), you may have trouble adding the file as a layer in a map. Remove extra spaces in the field names and try adding the file again.
  • Order and case do not matter (for example, you could have 519 East 86 Street,New York,NY,10028 or 519 east 86 street,new york,ny,10028). However, every row in the file must follow the same order.
  • When you add a .csv and .txt file with coordinate information or addresses while signed in with an organizational account, 4,000 rows can be added directly to the map. .csv and .txt files with more than 4,000 rows must be published as a hosted feature layer.
  • When you add a .csv and .txt file with addresses while signed in with a public account, or when you are not signed in, 250 features can be added directly to the map. .csv and .txt files with more addresses than this must be published as a hosted feature layer.
  • If the data in the file contains non-English characters—for example, characters specific to the French, Russian, Greek, Japanese, or Arabic alphabets—the file you import must be encoded as Unicode or UTF-8, and not ASCII. If you import an ASCII-encoded file containing non-English characters, it may display attribute values using unexpected characters. You can save a text file as UTF-8 or Unicode in Microsoft Windows. Open the file in a text editor such as Notepad, click File > Save As, and choose UTF-8 or Unicode from the Encoding drop-down menu shown at the bottom of the Save As dialog box.
  • If you use a URL to add a .csv file that includes number fields with decimals, the decimal characters in the file should match the format that your system language supports. For example, if your system is set to English, the file should use periods as decimals. If your system is set to French, the file should use commas as decimals.
  • When a .csv file containing latitude and longitude, MGRS, or USNG coordinates is added to a map, the coordinates are converted to the spatial reference of the current basemap.
  • .csv file items (including those with address information) cannot be added to a map; only the source file on disk or a hosted feature layer published from the .csv file can be added to a map. Similarly, .txt file items cannot be added to a map; only the source file on disk can be.

.gpx files

You can capture data with a GPS device and use a third-party tool or GPS manufacturer utility to convert the data to a GPX format file. Once you have a .gpx file, you can add it to Map Viewer Classic to visualize the data. The following types of data are supported in Map Viewer Classic:

  • Waypoints—These are points that the GPS user recorded manually, often specifying a name, to mark locations on the map.
  • Tracks—These are points the GPS device recorded automatically at a periodic interval. Tracks are rendered as linear features.
  • Routes—These are points the GPS device used to navigate to a specified location. Routes are rendered as linear features.

Considerations for using .gpx files

Keep the following in mind when using .gpx files:

  • .gpx files can contain multiple layers showing waypoints, tracks, and routes.
  • If no symbol is specified or if the symbol isn't part of a symbol set included in Map Viewer Classic, a default waypoint symbol is used.
  • You can add .gpx files to Map Viewer Classic, but you cannot add them as items through the My Content tab of the content page.