Displaying specific data from CSV file

Hello!

For number localization, you can take a look at this GitHub issue. Quoting @laurmaedje

Automatic locale-aware number formatting will happen

In the mean time @Andrew provides a simple solution for “1.1” to “1,1”.

#show regex("\d+\.\d+"): num => num.text.replace(".", ",")

You can restrict this to tables by only wrapping it in a table show rule.

For filtering columns in a csv, you can map-slice if the columns are contingous, or map-at

#let filtered = t.map(
  it => {
    // it.slice(0, 2)
    (it.at(0), it.at(1))
  }
)

The object given by csv is an array of rows, hence you apply map which operates on each row, selecting only the columns you want by index, starting from 0. Your solution also works! :smiley:

1 Like