Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

167
Views
¿Cómo puedo separar este archivo .txt para cada elemento usando js?

**Tengo una lista de avisos en un archivo .txt que me gustaría separar automáticamente en avisos individuales. El espacio en el archivo salió terriblemente mal (lo saqué del portal web de mi escuela) y hay descripciones duplicadas para cada aviso y mucho más espacio del que debería haber entre cada aviso, con sangrías extrañas.

El archivo .txt se parece a lo siguiente (los nombres de los maestros están ocultos):**

 Limited Boys' changing in the Sports Centre this afternoon. Any pupils needing to use the Boys' Changing Rooms in the Sports Centre this afternoon should use the adjacent Overflow Changing area instead. The Boys' Changing Rooms are reserved for the 1st XI's opposition. Boys' toilets can be accessed still via the door next to the Climbing wall in the Main Hall. Posted by: Teacher1 Any pupils needing to use the Boys' Changing Rooms in the Sports Centre this afternoon should use the adjacent Overflow Changing area instead. The Boys' Changing Rooms are reserved for the 1st XI's opposition. Boys' toilets can be accessed still via the door next to the Climbing wall in the Main Hall. Posted by: Teacher1 Wednesday at 1.15pm:Jewish Society (RoomLocation) 'The Interesting story: was it this positive thing, this positive thing, or this particularly negative thing?' Come to listen to this speech by this person at this time in this room in this building to learn about this thing. Posted by: Teacher2 'The Interesting story: was it this positive thing, this positive thing, or this particularly negative thing?' Come to listen to this speech by this person at this time in this room in this building to learn about this thing. Posted by: Teacher2

Consulte mi otra pregunta para ver cómo convertí un archivo .txt en un archivo .json con la ayuda de tuphamdev96.

Gracias de antemano por cualquier ayuda o consejo!

Intenté usar el convertidor que usé para los accesorios deportivos (ver mi otra publicación), pero como se hizo para convertir en función de ese espacio específico, no funcionó y no pude separar cada uno de los elementos.

Básicamente, me gustaría analizar estos datos y separarlos (eliminando espacios y duplicados) para usarlos como un archivo .json en mi sitio web de React. He creado archivos .json a partir de un archivo .txt de accesorios deportivos (con el espacio correcto, créditos para tuphamdev96) y simplemente me gustaría saber qué saltos de línea puedo separar para obtener cada elemento (como \n y \ r etc)

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!