Description
Load selected table columns as scalar fields or sampled vectors. Comma-delimited
input preserves empty cells and trims surrounding whitespace; a header without
commas selects legacy whitespace-delimited input. Every data row must match the
header's column count. Selected numeric cells must contain complete, in-range
numbers: empty or malformed numeric cells are errors, not zeros or prior values.
Fields mode supports fixed-width cN text; empty text is zero-padded. Quoted CSV
and embedded separators/newlines are not supported. Fields mode streams complete
validated rows; vector layouts buffer the selected values to determine lengths.
Synopsis
sgloadcsv mode=fields vector.fmt=float #.fmt="float" <stdin in.header=0 in.select= out.exclude= >stdout
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
mode |
enum |
fields
|
output layout: fields: one output column per table row; scalar numeric or fixed-width text fields vector: one data vector per selected table column vectors: one named vector per selected table column in a single output column |
vector.fmt |
enum |
float
|
sample type in vector mode; char stores one byte per cell |
#.fmt |
str |
float
|
per-column format: fields mode accepts float, int, long, double, or cN with a positive byte width; vectors mode accepts float, int, long, double, or char |
in |
ifile |
stdin
|
input table; comma-delimited or legacy whitespace-delimited, without quoted CSV |
in.header |
int |
0
|
zero-based row number containing column names |
in.select |
strs |
Unknown | columns to include; all columns are selected by default |
out.exclude |
strs |
Unknown | columns to exclude; unselected cells retain their column positions |
out |
ofile |
stdout
|
output SOIG dataset with selected scalar/text fields or sampled vectors, according to mode |
Input and output
Input
input table; comma-delimited or legacy whitespace-delimited, without quoted CSV
Output
output SOIG dataset with selected scalar/text fields or sampled vectors, according to mode
Examples
1. Import a numeric CSV table as scalar fields
sgloadcsv mode=fields <data.csv >data.sgThe first row supplies field names; each subsequent row becomes a SOIG column.
Selected fields default to float. Empty numeric cells stop the import with row,
column and field context.
2. Import fixed-width labels alongside numeric measurements
sgloadcsv mode=fields label.fmt=c8 value.fmt=double <labels.csv >labels.sgThe header must contain label,value. Empty labels become eight zero bytes;
nonempty labels retain up to eight bytes. Empty values are rejected.