Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

ISIS Documentation

csv2table

Convert a CSV file to a table and attach it to a cube

This application converts a CSV file to a table and attaches it to a cube. The first row of the CSV will be used as the fieldnames for the table. The contents of the CSV file will be converted to floating point numbers before they are inserted into the table.

A single table field with multiple values will be created for consecutive CSV columns with the same column name followed by an index inside parentheses. The index must start at zero and increase from left to right. For example a CSV header line like: "A, B(0), B(1), B(2), C", will create three table fields, A with size=1, B with size=3, and C with size=1.


Categories


Related Objects and Documents

Applications


History

Jesse Mapel2018-09-04 Original version
Stuart Sides2021-03-20 Added ability to convert CSV files with indicies into table field arrays instead of individual table fields.
Adam Paquette2024-10-08 Added the ability to pass types for each column in the CSV

Parameters

Files

Input CSV filename. The first row of this file will be used as the table field names.
Type filename
File Mode input
Filter *.csv

Input table label PVL filename. This is expected to be a flat PVL file where all of the keywords and their values will be added to the tabel label.
Type filename
File Mode input
Internal Default None
Filter *.pvl

Output cube filename that the table will be attached to
Type cube
File Mode output
Filter *.cub

Table

A table will be created with this name on the output cube using the data from the CSV file. If a table with this name already exists on the cube it will be overwritten.
Type string

ISIS command line list of Tablefield types. Specified as such, '(type1, type2)' where the allowed types are "Double", "Integer", "Float", "Text".
Type string
Default

Example 1

Write a simple table

Write a simple csv file to a cube.

Command Line

In this example, csv2table will write a table called TestTable on isisTruth.cub with the contents of test.csv.
csv2table csv=test.csv tablename=TestTable to=isisTruth.cub