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

164
Visualizações
How to create JSON file from XLSX but with some values as arrays of strings

I am using the code provided by @Parijat in this question to parse XLSX data into JSON format. I have some columns that contain multiple values per cell separated by commas and I would like have these formatted as arrays of strings in the JSON output.

For example:

id    Conditions 
1     influenza,asthma
2     influenza
3     high-blood pressure, influenza

I would like the JSON to be:

{
"id":1,
"conditions":["influenza", "asthma"]
},
{
"id":2,
"conditions":["influenza"]
}.
{
"id": 3,
"conditions":["high-blood pressure","influenza"]
}

Could someone be kind enough to show me how to adapt the code in the other question to produce JSON like this?

If it helps, I know in advance which columns need to be output as an array, so I have their column indexes, or could move them all to the start or end of the xlsx file.

about 4 years ago · Juan Pablo Isaza
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