bonjour,
je voudrai savoir comment transformer un fichier texte en fichier json
j'ai un fichier .txt qui ressemble à ceci
This is field decoder (./decoder.pl) version R4B109 ***
DocNo: 10/1551-axd 105 03/1, DocRev: cx2, Date: 2013-10-29, Increment: w13b cp1 plm: 13w44 sprint
Parsing UeRc ref: /home/colombna/decoder//etc/UeRc.cfg
Parsing disconnect_cfg: /home/colombna/decoder//etc/disconnect_codes.cfg
Parsing ranap_cfg: /home/colombna/decoder//etc/ranap_causes.cfg
###########################
Start Processing file: /cygdrive/c/cygwin/home/colombna/decoder/A20150715.1115+0300-1130+0300_SubNetwork=ANRNC02,MeContext=ANRNC02_rnc_gpehfile_Mp1.bin
###########################
Event Length (71), RecordType (4) RecNo.(0)
FFV CX2, force 1
[2015-07-15 08.15.01:285] SeefileDetailedupdateinfo-10-1551-RevCXattachedtothisdocumentinCDMfordetailedinformation. produced this event event id = (456) BUS XXX internal-call-setup-fail PDU ENCODED, ueRef = 2271 - - -
value EVENT ::=
{
scannerId '00000000 00000000 00000001'B,
hour 8,
minute 15,
second 1,
millisec 285,
events internal-call-setup-fail :
{
ue-context valid : 2271,
rnc-module-id valid : 1,
c-id-1 valid : 28158,
rnc-id-1 invalid : 4095,
c-id-2 invalid : 65535,
rnc-id-2 invalid : 4095,
c-id-3 invalid : 65535,
rnc-id-3 invalid : 4095,
c-id-4 invalid : 65535,
rnc-id-4 invalid : 4095,
source-conf valid : Idle (0),
c-id-serv-hsdsch-cell invalid : 65535,
crnc-id-serv-hsdsch-cell invalid : 4095,
source-connection-properties : 0,
target-conf valid : Idle (0),
target-connection-properties : 0,
wanted-conf valid : Standalone RRC on DCH (1),
wanted-connection-properties : 0,
procedure-indicator valid : event-value-rrc-connection-establishment-proc (15),
evaluation-case valid : event-value-not-applicable-eval (0),
exception-class valid : event-value-uu-interface-rrc-protocol-area (9),
cause-value valid : event-value-procedure-timeout (49),
extended-cause-value valid : value-out-of-range (14),
severity-indicator valid : 1,
trigger-point valid : event-value-rrc-connection-release (2),
utran-ranap-cause invalid : 1023,
cn-id valid : event-value-ps-cn (1),
originating-state valid : event-value-idle-orig (1),
rrc-establishment-cause valid : event-value-originating-interactive-call-est (2),
cello-aal2nci-reject-reason valid : event-value-not-applicable-aal2 (0),
source-c-id-1-secondary-serv-hsdsch-cell invalid : 65535,
source-connection-properties-ext : 0,
target-connection-properties-ext : 0,
wanted-connection-properties-ext : 0,
imeisv : ffffffffffffffff,
csfb valid : event-value-no-csfb-csfb (0),
}
}
Event Length (71), RecordType (4) RecNo.(1)
FFV CX2, force 1
[2015-07-15 08.15.01:376] SeefileDetailedupdateinfo-10-1551-RevCXattachedtothisdocumentinCDMfordetailedinformation. produced this event event id = (456) BUS XXX internal-call-setup-fail PDU ENCODED, ueRef = 4677 - - -
value EVENT ::=
{
scannerId '00000000 00000000 00000001'B,
hour 8,
minute 15,
second 1,
millisec 376,
events internal-call-setup-fail :
{
ue-context valid : 4677,
rnc-module-id valid : 1,
c-id-1 valid : 38158,
rnc-id-1 valid : 2,
c-id-2 invalid : 65535,
rnc-id-2 invalid : 4095,
c-id-3 invalid : 65535,
rnc-id-3 invalid : 4095,
c-id-4 invalid : 65535,
rnc-id-4 invalid : 4095,
source-conf valid : Standalone RRC on DCH (1),
c-id-serv-hsdsch-cell invalid : 65535,
crnc-id-serv-hsdsch-cell invalid : 4095,
source-connection-properties : 0,
target-conf valid : Standalone RRC on DCH (1),
target-connection-properties : 0,
wanted-conf valid : PACKET 64/64 (5),
wanted-connection-properties : 0,
procedure-indicator valid : event-value-rab-establishment-proc (1),
evaluation-case valid : event-value-not-applicable-eval (0),
exception-class valid : event-value-rn-ul-resource-availability (2),
cause-value valid : event-value-no-of-simultaneous-rl-on-sf16-exceeded-for-non-guaranteed-service-class (22),
extended-cause-value valid : event-value-extended-cause-value-not-applicable (0),
severity-indicator valid : 0,
trigger-point valid : event-value-ranap-rab-assignment-request (0),
utran-ranap-cause valid : no_resource_available (114),
cn-id valid : event-value-ps-cn (1),
originating-state valid : event-value-idle-orig (1),
rrc-establishment-cause valid : event-value-originating-interactive-call-est (2),
cello-aal2nci-reject-reason valid : event-value-not-applicable-aal2 (0),
source-c-id-1-secondary-serv-hsdsch-cell invalid : 65535,
source-connection-properties-ext : 0,
target-connection-properties-ext : 0,
wanted-connection-properties-ext : 0,
imeisv : ffffffffffffffff,
csfb valid : event-value-no-csfb-csfb (0),
}
}
et je voudrai le transformer comme ceci
{ "events internal-call-setup-fail" :[ { "ue-context valid" : "2271", "rnc-module-id valid" : "1", "c-id-1 valid" : "28158", "rnc-id-1 invalid" : "4095", "c-id-2 invalid" : "65535", "rnc-id-2 invalid" : "4095", "c-id-3 invalid ": "65535", "rnc-id-3" invalid : "4095", " c-id-4 invalid" : "65535", "rnc-id-4 invalid" :" 4095", "source-conf valid" : " Idle 0", "c-id-serv-hsdsch-cell invalid" : "65535", "crnc-id-serv-hsdsch-cell invalid" : "4095", "source-connection-properties" : "0", "target-conf valid" : "Idle 0", "target-connection-properties" : "0", "wanted-conf valid" : "Standalone RRC on DCH 1", "wanted-connection-properties" : "0", "procedure-indicator valid" : "event-value-rrc-connection-establishment-proc 15", "evaluation-case valid" : "event-value-not-applicable-eval 0", "exception-class valid" : "event-value-uu-interface-rrc-protocol-area 9", "cause-value valid" : "event-value-procedure-timeout 49", "extended-cause-value valid" : "value-out-of-range 14", "severity-indicator valid" :" 1", "trigger-point valid" : "event-value-rrc-connection-release 2", "utran-ranap-cause invalid" : "1023", "cn-id valid" : "event-value-ps-cn 1", "originating-state valid" :" event-value-idle-orig 1", "rrc-establishment-cause valid" : "event-value-originating-interactive-call-est 2", "cello-aal2nci-reject-reason valid" : "event-value-not-applicable-aal2 0", "source-c-id-1-secondary-serv-hsdsch-cell invalid" : "65535", "source-connection-properties-ext" : "0", "target-connection-properties-ext" : "0", "wanted-connection-properties-ext" : "0", "imeisv" : "ffffffffffffffff", "csfb valid" : "event-value-no-csfb-csfb 0", } , { " ue-context valid" :" 4677", "rnc-module-id valid" : "1", "c-id-1 valid" : "38158", "rnc-id-1 valid" :" 2", "c-id-2 invalid" : "65535", "rnc-id-2 invalid" : "4095", "c-id-3 invalid" : "65535", "rnc-id-3 invalid" : "4095", "c-id-4 invalid" :" 65535", "rnc-id-4 invalid ":" 4095", " source-conf valid ": "Standalone RRC on DCH 1", "c-id-serv-hsdsch-cell invalid" : "65535", "crnc-id-serv-hsdsch-cell invalid" : "4095", "source-connection-properties" : "0", "target-conf valid ": "Standalone RRC on DCH 1", "target-connection-properties" :" 0", "wanted-conf valid" : " PACKET 64 sur 64 5", "wanted-connection-properties" : "0", "procedure-indicator valid" : "event-value-rab-establishment-proc 1", "evaluation-case valid" :" event-value-not-applicable-eval 0", "exception-class valid" : "event-value-rn-ul-resource-availability 2", "cause-value valid" : "event-value-no-of-simultaneous-rl-on-sf16-exceeded-for-non-guaranteed-service-class 22", "extended-cause-value valid" : "event-value-extended-cause-value-not-applicable 0", "severity-indicator valid" :" 0", "trigger-point valid" : "event-value-ranap-rab-assignment-request 0", "utran-ranap-cause valid ":" no_resource_available 114", "cn-id valid" : "event-value-ps-cn 1", "originating-state valid" : "event-value-idle-orig 1", "rrc-establishment-cause valid" : "event-value-originating-interactive-call-est 2", "cello-aal2nci-reject-reason valid" : "event-value-not-applicable-aal2 0", "source-c-id-1-secondary-serv-hsdsch-cell invalid" : "65535", "source-connection-properties-ext" : "0", " target-connection-properties-ext" :" 0", "wanted-connection-properties-ext" : "0", "imeisv" : "ffffffffffffffff", "csfb valid" : "event-value-no-csfb-csfb 0", }] }
est-ce-que quelqu'un pourrai m'aider j'ai dejà cherché par tous et j'arrive pas à le faire,
besoin d'aide
merci
jayzman
Afficher la suite
28 janv. 2016 à 09:51
Ok,j'ai bien compris
28 janv. 2016 à 17:56
29 janv. 2016 à 08:16