Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

163
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda