load csv

From DavinciWiki
Jump to: navigation, search


Description

Reads a CSV file into a structure.

Arguments and Return Values

Arguments: A string containing file to be loaded

Return Value: A Davinci structure

Usage

Syntax: load_csv(filename = PATH, [ separator = 1], [ header = 1])

CSV files contain text and/or numbers separated by delimiter, usually a comma.

  • The FILENAME argument specifies whether the CSV file to load.
  • The SEPARATOR argument specifies the character that is being used to separate columns in the file. (default is the tab character "\t", can be set to any ascii character)
  • The HEADER argument specifies whether or not the file contains a header row. (0=no header, default is 1)
  • The COLLAPSE argument is not currently understood, needs to be verified with Devs

Examples

dv> a=load_csv("csv_test.csv",separator=",",header=0,collapse=0)

struct, 6 elements
   c1: 0.005286009982	
   c2: 0.004267709795	
   c3: 0.004036929924	
   c4: 0.003751439974	
   c5: 0.003269399982	
   c6: 0.002864310052	

dv> a.c1

   0.005286009982	

dv>

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Related Functions

Recent Core Changes

Modified On: 03-17-2020

Personal tools