• User Newbie

    php e file di testo

    Buon giorno,

    qualche esperto mi può indicare come spostare una stringa dentro un file di testo?

    Io ho questo file formattato così:

    [00:16:06.96] ??? Nut Corporation (Nut) starts turn
    [00:16:26.64] ??? Nut Corporation (Nut) fires Granata (5 sec, min bounce)
    [00:16:33.20] ??? Nut Corporation (Nut) ends turn; time used: 19.66 sec turn, 3.00 sec retreat
    [00:16:36.84] ??? Damage dealt: 5 to Giambel V Squad (wm`Sardus)

    avrei bisogno che la stringa:
    [00:16:36.84] ??? Damage dealt: 5 to Giambel V Squad (wm`Sardus)

    venga tagliata e copiata al termine della
    stringa:
    [00:16:26.64] ??? Nut Corporation (Nut) fires Granata (5 sec, min bounce)

    diviso da un trattino - oppure anche uno spazio ,

    questo per tutte le stringhe uguali presenti nel file.

    praticamente la stringa
    [00:16:36.84] ??? Damage dealt: 5 to Giambel V Squad (wm`Sardus)
    dovrebbe salire di una riga ed aggiungersi alla riga precedente.

    Perciò, queste due righe:
    [00:16:26.64] ??? Nut Corporation (Nut) fires Granata (5 sec, min bounce) [00:16:36.84] ??? Damage dealt: 5 to Giambel V Squad (wm`Sardus)

    dovrebbero diventare una sola riga.

    grazie