Read_Column_File


Synopsis

reads an ASCII file containing any number of separated columns

Input Ports

parent

UIconnection

 

Parameters

Filename

UIfileSB

name of the file to read

skip lines

UIfield

number of lines to skip

has header line

UItoggle

if set, use header to get column names

column separator

UIradioBox

selects column separator

user separator

UIfield

custom column separator

columns setup from file

UItoggle

if set, column names and types are determined automatically by reading first lines of file

# columns in file

UIfield

number of columns in file

Columns Setup

UIoptionMenu

selects a column whose parameters are to be set

read column

UItoggle

if set, read this column

column name

UIfield

name of the column

data type

UIradioBox

selects the type of a column

null value

UIfield

value for missing column entries

Read File

UIbutton

causes file to be read

 

Output Ports

table

Data_Array

 

Description

The Read_Column_File module reads any ASCII file that contains columns of data separated by a special character or sequence of characters. The columns in the file can be of any type: character strings, integers, or real numbers. Optionally, the file can have a header line that contains the column's names. The module stops reading when it reaches the end of the file.

Here are some simple examples of column-formatted ASCII files. The following file has three columns separated by spaces:


1 bob 180.3
2 jim 230.65
3 bill 201.6

The next file contains the same three columns of data, but the columns are separated by (nonprinting) tab characters and the file has a header:


# name weight
1 bob 180.3
2 jim 230.65
3 bill 201.6

Column-formatted ASCII files are produced by many software packages; spreadsheets are common examples.

Read_Column_File provides a number of column parameters that you can use to specify whether and how individual columns in the file are processed. You use the Column Setup menu to specify a column whose parameters you want to set, and then use the following parameters to set processing specifics:

read column