**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: Teacher2Consulte 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)