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

267
Vistas
How to restrict text in one column if the text is having multiple commas while generating csv throigh mongo command
In the JSON commas were there in the remarks column text so when we execute mongo command ,in the csv file ,remarks was going to the multiple cells.Can we restrict whole remarks column should be in one cell?

mongo dbEntityDB dbEntity.js > out.csv

db.dbEntity.insertOne( 
{
    "employee": {

        
        "employeeId": "46363366",
        "name": "wrwr",
        "remarks": "abcd,efgh"
        

    }
}
)


dbEntity.js
************

print("employeeId,name,remarks");

cursor=db.dbEntity.find();


let out="";

while(cursor.hasNext()){
    
    
    jsonobj=cursor.next();
    
    employeeId =    jsonobj.employee.employeeId;
    name =    jsonobj.employee.name;
    remarks =    jsonobj.employee.remarks;
    
    out =out+ employeeId +","+name +","+customerName+","+remarks+"\n";
    
};

print(out)
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