# uniformrowtype

### Introduction

UniformRowType can be used to load the CSV data in a more raw format rather than generating a custom class for the CSV. This is useful if the data in the CSV needs to be accessed by row and column index rather than by class member names. For this guide we'll be using a CSV with the following data:

![](/files/DH8gLI9Bok2rsx7dfQFD)

### Default Functionality

Before changing the UniformRowType value, we should look at the code generated by Glue for this CSV. The class that contains the CSV will have a dictionary of objects as shown in the following code:

```lang:c#
public static System.Collections.Generic.Dictionary<string, RedgrinTest3.DataTypes.Csv> CsvFile { get; set; }
```

In this case the Csv class is generated as shown in the following snippet:

```lang:c#
public partial class Csv
{
    public string Column1;
    public string Column2;
    public string Column3;
    ...
```

In this case we could access the CSV data through the CsvFile member. If the CSV were part of GlobalContent we could get the information as shown in the following code:

```lang:c#
var value = GlobalContent.CsvFile["Value 1"].Column1;
```

Note that we access the first column using the Column1 property.

### Setting UniformRowType

We can change the UniformRowType to **string\[]** to change how Glue generates the CSV code.

![](/files/hTJv1XT4ryh6lX6aKVdL)

This setting tells Glue to generate each row in the CSV as a string\[], allowing us to index into each column as shown in the following code:

```lang:c#
var value = GlobalContent.CsvFile["Value 1"][0];
```

### String vs. String\[]

Glue offers two options for UniformRowType:

1. String
2. String\[]

The most commonly used value is String\[] which tells glue that each row contains multiple values. Since each value in a row may need to be independently accessed, each row is represented as a string array. For example, to access index 3 in a row, your code may look like:

```lang:c#
var row = LoadedCsv[2]; // row at index 2
var value = row[3]; // value at index 3 in the selected row
```

If your CSV has only one column, then the UniformRowType can be String. This can simplify accessing the row. For example, to access the first item in the row at index 2, your code may look like:

```lang:c#
var value = LoadedCsv[2]; // this is a string
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flatredball.com/flatredball/glue-reference/files/file-types/glue-reference-csv/uniformrowtype.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
