Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

162
Visualizações
js.p5 table object: access row using a string, similar to colum header

Is there a way to access a p5.js table object row using a string - similar to accessing a table column using its header?

For example, the following csv table contains greeting and parting in different languages:

,EN, FR
greeting, hello, bonjour
parting, goodbye, aurevoir

I want to print 'hello' without using row or column index numbers, just strings:

var table = loadTable(greet-part.csv', 'csv', 'header');

print(table.get("greeting", "EN"));

I could write some more code linking 0 to 'greeting', 1 to 'parting' etc but this would become cumbersome on a large scale:

Ideas for a more elegant solution?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You could try findRow().

Not, tested, but in you case you could try something like:

table.findRow("greeting", 0).get("EN");
  • the above roughly translates to find the first occurance of "gretting" on the 1st column (index 0) and retrieve that row, then from that row retrieve the value under the "EN" column
  • 0 refers to column zero (since in your example it doesn't have a name))
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda