CSV range and select a single row

Hello there!

I’m trying to select a single column of my CSV:


{{ range $i, $r := getCSV "," "csv/bookslist.csv" }}
{{ . }}
{{ end }}

I can display the entire thing, but how do I select the first column. Or the second?

I want to be able to display certain elements of each column.

Like: .Title, .Author, .Special, etc for column B, for instance.

I can also display one column, but it prints the entire thing, I want to select one row at the time.

/// this prints the entire column

{{ range $i, $r := getCSV "," "csv/bookslist.csv" }}
{{ index $r 2 }}<br>
{{ end }}

I want to be able to print just the Title for instance, or just the Author

<h2>Book</h2>
<span>Treasure Island</span>

<h2>Author</h2>
<span>Javier</span>

<h2>Published</h2>
<span>Thursday, 20,... etc</span>

Heeeelllllppppp!

Hi,

Do you just want the value of a cell given $row and $col number?

{{ $csv := getCSV $sep $url }}

{{ $r := 0 }}
{{ $c := 1 }}
{{ index ( index $csv $r ) $c }}

Or am I misunderstanding the question?