Function Description
CSV (or Comma Separate Values) is a file that records data in text form (usually with a comma as a Separator), which is often used as a format for data exchange between different programs.
The user can convert the attribute data in the format of *.xlsx, *.xls, *.xml, etc. Into the data in the format of *.csv through the Excel tool, and then realize the Data Import 。
At the same time, it supports the import of attribute data in txt (*.txt) format that meets the CSV format specification, and users can directly import it without Data Conversion.
The following issues should be noted in the specific file format:
- The beginning cannot be left blank and is in line units. Each record is one line.
- Text can only contain information such as Separator and field values.
- The English comma is used as the Separator by default. are also supported.
- The first record can be a field name.
As shown in the figure below, the contents of the *.csv file to be imported are as shown in the figure below. Comma ( ",") in English is used as Separator for CSV data, and the first line is Select Fields of data. It contains four columns of attribute data, and the meaning of each column is: X coordinate value, Y coordinate value, type code and color.
Function entrance
- Start tab-> Data Processing-> Data Import.
- In Workspace Manager-> Datasource Context Menu-> Import Dataset...
- Toolbox-> Data Import-> Spread sheet-> Import CSV.
Operating instructions
- On the Data Import dialog, add a *.csv format file to be imported as described in Import Data .
- Result Data and Source File Info: See Introduction to public parameters.
- Transformation Parameters
- Separator: used to set the Separator in CSV File. English comma (,) is used by default. The optional Separator also has dot (.), Tab, and space. The system also supports User Custom as a text-recognizable character (including Chinese characters).
- 1st Row as Header: Set whether the first line of the original CSV File to be imported is Field. If this parameter is checked, the imported Field is the field value in the first row, otherwise, it is Attributes. If Select Fields is specified in the first line of the CSV File, the Application is automatically read.
- Auto Length: Set whether to import Auto Length. If this parameter is checked, the longest field of each column will be read during import, and 10 will be added as the Field length of this column. Checking this when importing a large amount of data may affect the import speed.
- Data Preview: to preview the effect of importing CSV File as property sheet data.
- Import Spa tial Data: If this check box is checked, the imported data is Point Dataset; if it is not checked, it is Tabular Dataset.
- WKT field: Spatial Info of Get Data by specifying WKT field. For details on the WKT data format, refer to the WKT Text Markup Language .
- Coordinate Field: Specify Spatial Info corresponding to CSV data by setting longitude, latitude and Elevation Field.
- After setting, click the Import button to import the CSV File. The imported Point Dataset or property sheet data is as follows:
- When editing a CSV File
- with a text editing tool such as Notepad, if there are half-width special characters (commas, line breaks, or double quotes) in the column content, you need to use half-width double quotes to escape the field values. If half-width quotation marks (that is, "") are present in the column content, they should be replaced with half-width double quotation marks ( "") escaped and the string enclosed in half-width quotation marks. If the field value needs to be Venture "Extended Edition" after importing, it should be written as Venture "" Extended Edition "" "in CSV File; After importing, if the field value is "Supermap", it can be written as "" Supermap "" or "" Supermap "" "in CSV File.
- When editing CSV File with Microsoft Excel tool, if there are special characters in the field content, there is no need to add escape characters for transcoding. Excel will automatically escape the special characters in the cell when saving the CSV File.
Related topics
Data Formats Supported by Type Conversion