traitement de chaines de caractères
Posté : 07 nov. 2014, 18:03
Bonjour,
Je viens demander de l'aide. J'ai un fichier texte. Après des explodes,je recupére des lignes que j'affiche ci dessous. En exemple :
Ceci forme une ligne ===>GRE_JEAN_JAURES;NW/UTRAN BTSEquipment/GRE_JEAN_JAURES Board/723467;10-04-2014 11:14:28;null;processing error;warning;active;softwareProgramError;TRDU/11 SOFTWARE DUMP;TRDU/11 SOFTWARE DUMP Specific Problem:TRDU/11 SOFTWARE DUMP, Cabinet:11, Shelf:10, Slot-position:11, AdditionalInformationFromNE:additionalInformation = { manufacturerInfoAscii = GP_TRDU Pmdz :The system was power-cycled. - Cause:1 - RRH F/W:_BI_RE_TE_TR_BAND01_FV_1.2.18 - HwRel:AB04 - PEC:3JR21012AB - SN: GPCSTW1000501913 - MOD:TRDUBAND014C60W - SWver:UNB0814A110 } ;BTS_0002_00064;
Celle ci une autre ====>CINQ_AVENUES;NW/UTRAN BTSEquipment/CINQ_AVENUES Board/81;10-04-2014 15:47:45;null;processing error;warning;active;softwareProgramError;CCM/81 SOFTWARE DUMP;CCM/81 SOFTWARE DUMP Specific Problem:CCM/81 SOFTWARE DUMP, Cabinet:0, Shelf:0, Slot-position:81, AdditionalInformationFromNE:additionalInformation = { manufacturerInfoAscii = Uptime : 52 days 04:05:43.Sequence num: 32.Thread name : tCpManager.Thread ID : 0x36ddb4b0.Error number: 0.Signal : 11.State and Misc Registers:. TRAP : 00000300. MSR : 0202d200. DAR : 00000096. DSISR: 00800000. IAR : 0d39299c. SP : 36dda7e0. LR : 0d391810. CR : 24004442. CTR : 0cdb1d60. XER : 00000000.Traceback:. 0d39299c. 0d3e1a80. 0d407f64. 0 f79ef74. 0d47c590. 0d47d00c. 0f822178. 0fd22ccc. 30028d8c. 0ff25a90. 00000000. 00000000. 00000000. 00000000. 00000000 . 00000000. 00000000. 00000000. 00000000. 00000000.HwRel:CA01 - PEC:3JR20073BC - SN:YP14160B64C - MOD:MOD:eCCM-U_GE - SWver :UNB0814A110 } ;BTS_0002_00001;
Ce que je voudrais c'est prendre PEC et la valeur qui suit exemple pour la ligne une PEC:3JR21012AB et pour la ligne deux PEC:3JR20073BC. J'y arive avec des explodes mais vu que les deux phrases n'ont pas la même taille, j'arrive à le récupérer sur la première et non sur la deuxième. Si possible avait vous une solution qui permettrait de le prendre dans toutes mes lignes et quelque soit sa taille.
Bien cordialement.
Je viens demander de l'aide. J'ai un fichier texte. Après des explodes,je recupére des lignes que j'affiche ci dessous. En exemple :
Ceci forme une ligne ===>GRE_JEAN_JAURES;NW/UTRAN BTSEquipment/GRE_JEAN_JAURES Board/723467;10-04-2014 11:14:28;null;processing error;warning;active;softwareProgramError;TRDU/11 SOFTWARE DUMP;TRDU/11 SOFTWARE DUMP Specific Problem:TRDU/11 SOFTWARE DUMP, Cabinet:11, Shelf:10, Slot-position:11, AdditionalInformationFromNE:additionalInformation = { manufacturerInfoAscii = GP_TRDU Pmdz :The system was power-cycled. - Cause:1 - RRH F/W:_BI_RE_TE_TR_BAND01_FV_1.2.18 - HwRel:AB04 - PEC:3JR21012AB - SN: GPCSTW1000501913 - MOD:TRDUBAND014C60W - SWver:UNB0814A110 } ;BTS_0002_00064;
Celle ci une autre ====>CINQ_AVENUES;NW/UTRAN BTSEquipment/CINQ_AVENUES Board/81;10-04-2014 15:47:45;null;processing error;warning;active;softwareProgramError;CCM/81 SOFTWARE DUMP;CCM/81 SOFTWARE DUMP Specific Problem:CCM/81 SOFTWARE DUMP, Cabinet:0, Shelf:0, Slot-position:81, AdditionalInformationFromNE:additionalInformation = { manufacturerInfoAscii = Uptime : 52 days 04:05:43.Sequence num: 32.Thread name : tCpManager.Thread ID : 0x36ddb4b0.Error number: 0.Signal : 11.State and Misc Registers:. TRAP : 00000300. MSR : 0202d200. DAR : 00000096. DSISR: 00800000. IAR : 0d39299c. SP : 36dda7e0. LR : 0d391810. CR : 24004442. CTR : 0cdb1d60. XER : 00000000.Traceback:. 0d39299c. 0d3e1a80. 0d407f64. 0 f79ef74. 0d47c590. 0d47d00c. 0f822178. 0fd22ccc. 30028d8c. 0ff25a90. 00000000. 00000000. 00000000. 00000000. 00000000 . 00000000. 00000000. 00000000. 00000000. 00000000.HwRel:CA01 - PEC:3JR20073BC - SN:YP14160B64C - MOD:MOD:eCCM-U_GE - SWver :UNB0814A110 } ;BTS_0002_00001;
Ce que je voudrais c'est prendre PEC et la valeur qui suit exemple pour la ligne une PEC:3JR21012AB et pour la ligne deux PEC:3JR20073BC. J'y arive avec des explodes mais vu que les deux phrases n'ont pas la même taille, j'arrive à le récupérer sur la première et non sur la deuxième. Si possible avait vous une solution qui permettrait de le prendre dans toutes mes lignes et quelque soit sa taille.
Bien cordialement.