Trier un fichier trace

Trier un fichier trace - VB/VBA/VBS - Programmation

Marsh Posté le 17-04-2019 à 21:47:24    

Bonjour à tous,
J'ai un fichier trace ci dessous que je veux trier en fonction de la référence (exemple pour le premier appel: Ref: O,5 dans la 2ième ligne)
A noter que la référence Ref: D,5 fait partie du premier appel (En fait seul le chiffre derriere le "O" ou le "D" m'importe dans mon tri)
Mon tri doit donc prendre en compte la ligne qui précéde le ligne comportant la référence Ref: "O" ou "D",chiffre (et qui commence par ISDN3)
et aller jusqu'au "ISDN3" qui suit.
 
PS: JE me fiche des couleur c'est juste pour la comprehension de mes explications
 
Et merci à vous par avance car je seche.
 
CI DESSOUS LE FICHIER NON TRIE: (et plus bas le fichier trié)
 
ISDN3_00012 11/04 10:51:17 RX d_channel: 43 (S:00 T:127) payload: (38) 08 01 05 05 A1 04 03 80 90 A3 18 01 89 6C 0B 21 83 36 38 35 39 34 32 30 31 38 70 0A A1 33 38 35 32 39 31 38 34 34
0x05 SETUP Ref: O,5
  ie 0xA1 Sending complete
  ie 0x04 Bearer capability: 80 90 A3
    Coding: CCITT standardized
    Information transfer capability: Speech
    Transfer mode: Circuit mode
    Transfer rate: 64 Kbit/s
    User info layer 1: G.711 A-law
  ie 0x18 Channel identification: 89
    Interface identifier: Implicit
    Interface type: Basic
    Indicated channel: Exclusive
    D-channel identified: Yes
    Information channel selection: B1 channel
  ie 0x6C Calling party number: 21 83 36 38 35 39 34 32 30 31 38
    Number type: National number
    Numbering plan: ISDN/Telephony(CCITT Recommendation E.164/E.163)
    Presentation: presentation allowed
    Screening: network provided
    Number: 685942018
  ie 0x70 Called party number: A1 33 38 35 32 39 31 38 34 34
    Number type: National number
    Numbering plan: ISDN/Telephony(CCITT Recommendation E.164/E.163)
    Number: 385291844
ISDN3_00013 11/04 10:51:17 TX d_channel: 43 (S:00 T:000) payload: (4) 08 01 85 02
0x02 CALL_PROCEEDING Ref: D,5
ISDN3_00017 11/04 10:51:17 TX d_channel: 43 (S:00 T:000) payload: (4) 08 01 85 01
0x01 ALERTING Ref: D,5
ISDN3_00022 11/04 10:51:18 TX d_channel: 43 (S:00 T:000) payload: (17) 08 01 85 07 4C 0B 21 81 33 38 35 32 39 31 38 34 34
0x07 CONNECT Ref: D,5
  ie 0x4C: 21 81 33 38 35 32 39 31 38 34 34
ISDN3_00023 11/04 10:51:19 RX d_channel: 43 (S:00 T:000) payload: (4) 08 01 05 0F
0x0F CONNECT_ACK Ref: O,5
ISDN3_00071 11/04 10:51:49 RX d_channel: 41 (S:00 T:127) payload: (38) 08 01 35 05 A1 04 03 80 90 A3 18 01 89 6C 0B 21 83 36 38 35 39 34 32 30 31 39 70 0A A1 33 38 35 32 39 31 38 34 35
0x05 SETUP Ref: O,53
  ie 0xA1 Sending complete
  ie 0x04 Bearer capability: 80 90 A3
    Coding: CCITT standardized
    Information transfer capability: Speech
    Transfer mode: Circuit mode
    Transfer rate: 64 Kbit/s
    User info layer 1: G.711 A-law
  ie 0x18 Channel identification: 89
    Interface identifier: Implicit
    Interface type: Basic
    Indicated channel: Exclusive
    D-channel identified: Yes
    Information channel selection: B1 channel
  ie 0x6C Calling party number: 21 83 36 38 35 39 34 32 30 31 39
    Number type: National number
    Numbering plan: ISDN/Telephony(CCITT Recommendation E.164/E.163)
    Presentation: presentation allowed
    Screening: network provided
    Number: 685942019
  ie 0x70 Called party number: A1 33 38 35 32 39 31 38 34 35
    Number type: National number
    Numbering plan: ISDN/Telephony(CCITT Recommendation E.164/E.163)
    Number: 385291845
ISDN3_00072 11/04 10:51:49 TX d_channel: 41 (S:00 T:000) payload: (4) 08 01 B5 02
0x02 CALL_PROCEEDING Ref: D,53
ISDN3_00077 11/04 10:51:49 TX d_channel: 41 (S:00 T:000) payload: (4) 08 01 B5 01
0x01 ALERTING Ref: D,53
ISDN3_00081 11/04 10:51:50 TX d_channel: 41 (S:00 T:000) payload: (17) 08 01 B5 07 4C 0B 21 81 33 38 35 32 39 31 38 34 34
0x07 CONNECT Ref: D,53
  ie 0x4C: 21 81 33 38 35 32 39 31 38 34 34
ISDN3_00082 11/04 10:51:50 RX d_channel: 41 (S:00 T:000) payload: (4) 08 01 35 0F
0x0F CONNECT_ACK Ref: O,53
ISDN3_00138 11/04 10:52:00 TX d_channel: 41 (S:00 T:000) payload: (8) 08 01 B5 45 08 02 85 90
0x45 DISCONNECT Ref: D,53
  ie 0x08 Cause: 85 90
    Coding: CCITT standardized
    Location: Private network serving the remote user
    Class: Normal event
    Value: Normal release
ISDN3_00147 11/04 10:52:00 RX d_channel: 41 (S:00 T:000) payload: (4) 08 01 35 4D
0x4D RELEASE Ref: O,53
ISDN3_00148 11/04 10:52:00 TX d_channel: 41 (S:00 T:000) payload: (4) 08 01 B5 5A
0x5A RELEASE_COMP Ref: D,53
ISDN3_00041 11/04 10:52:31 RX d_channel: 43 (S:00 T:000) payload: (12) 08 01 05 45 08 02 80 90 1E 02 82 88
0x45 DISCONNECT Ref: O,5
  ie 0x08 Cause: 80 90
    Coding: CCITT standardized
    Location: User
    Class: Normal event
    Value: Normal release
  ie 0x1E Progress indicator: 82 88
    Coding: CCITT standardized
    Location: Public network serving the local user
    Progress: In-band information or appropriate pattern now available
SAN_00043  at line 7527 "dls_tests."
          on 11.04 at 10:51:31 (1462792007)  
          info : FFFF FFF9 FFFF FFFF 0000 0086 4AE5 B998  
ISDN3_00044 11/04 10:52:31 TX d_channel: 43 (S:00 T:000) payload: (8) 08 01 85 4D 08 02 81 90
0x4D RELEASE Ref: D,5
  ie 0x08 Cause: 81 90
    Coding: CCITT standardized
    Location: Private network serving the local user
    Class: Normal event
    Value: Normal release
ISDN3_00059 11/04 10:52:32 RX d_channel: 43 (S:00 T:000) payload: (4) 08 01 05 5A
0x5A RELEASE_COMP Ref: O,5
 
 
FICHIER TRIE:
 
ISDN3_00012 11/04 10:51:17 RX d_channel: 43 (S:00 T:127) payload: (38) 08 01 05 05 A1 04 03 80 90 A3 18 01 89 6C 0B 21 83 36 38 35 39 34 32 30 31 38 70 0A A1 33 38 35 32 39 31 38 34 34
0x05 SETUP Ref: O,5
  ie 0xA1 Sending complete
  ie 0x04 Bearer capability: 80 90 A3
    Coding: CCITT standardized
    Information transfer capability: Speech
    Transfer mode: Circuit mode
    Transfer rate: 64 Kbit/s
    User info layer 1: G.711 A-law
  ie 0x18 Channel identification: 89
    Interface identifier: Implicit
    Interface type: Basic
    Indicated channel: Exclusive
    D-channel identified: Yes
    Information channel selection: B1 channel
  ie 0x6C Calling party number: 21 83 36 38 35 39 34 32 30 31 38
    Number type: National number
    Numbering plan: ISDN/Telephony(CCITT Recommendation E.164/E.163)
    Presentation: presentation allowed
    Screening: network provided
    Number: 685942018
  ie 0x70 Called party number: A1 33 38 35 32 39 31 38 34 34
    Number type: National number
    Numbering plan: ISDN/Telephony(CCITT Recommendation E.164/E.163)
    Number: 385291844
ISDN3_00013 11/04 10:51:17 TX d_channel: 43 (S:00 T:000) payload: (4) 08 01 85 02
0x02 CALL_PROCEEDING Ref: D,5
ISDN3_00017 11/04 10:51:17 TX d_channel: 43 (S:00 T:000) payload: (4) 08 01 85 01
0x01 ALERTING Ref: D,5
ISDN3_00022 11/04 10:51:18 TX d_channel: 43 (S:00 T:000) payload: (17) 08 01 85 07 4C 0B 21 81 33 38 35 32 39 31 38 34 34
0x07 CONNECT Ref: D,5
  ie 0x4C: 21 81 33 38 35 32 39 31 38 34 34
ISDN3_00023 11/04 10:51:19 RX d_channel: 43 (S:00 T:000) payload: (4) 08 01 05 0F
0x0F CONNECT_ACK Ref: O,5
ISDN3_00041 11/04 10:52:31 RX d_channel: 43 (S:00 T:000) payload: (12) 08 01 05 45 08 02 80 90 1E 02 82 88
0x45 DISCONNECT Ref: O,5
  ie 0x08 Cause: 80 90
    Coding: CCITT standardized
    Location: User
    Class: Normal event
    Value: Normal release
  ie 0x1E Progress indicator: 82 88
    Coding: CCITT standardized
    Location: Public network serving the local user
    Progress: In-band information or appropriate pattern now available
SAN_00043  at line 7527 "dls_tests."
          on 11.04 at 10:51:31 (1462792007)  
          info : FFFF FFF9 FFFF FFFF 0000 0086 4AE5 B998  
ISDN3_00044 11/04 10:52:31 TX d_channel: 43 (S:00 T:000) payload: (8) 08 01 85 4D 08 02 81 90
0x4D RELEASE Ref: D,5
  ie 0x08 Cause: 81 90
    Coding: CCITT standardized
    Location: Private network serving the local user
    Class: Normal event
    Value: Normal release
ISDN3_00059 11/04 10:52:32 RX d_channel: 43 (S:00 T:000) payload: (4) 08 01 05 5A
0x5A RELEASE_COMP Ref: O,5
ISDN3_00071 11/04 10:51:49 RX d_channel: 41 (S:00 T:127) payload: (38) 08 01 35 05 A1 04 03 80 90 A3 18 01 89 6C 0B 21 83 36 38 35 39 34 32 30 31 39 70 0A A1 33 38 35 32 39 31 38 34 35
0x05 SETUP Ref: O,53
  ie 0xA1 Sending complete
  ie 0x04 Bearer capability: 80 90 A3
    Coding: CCITT standardized
    Information transfer capability: Speech
    Transfer mode: Circuit mode
    Transfer rate: 64 Kbit/s
    User info layer 1: G.711 A-law
  ie 0x18 Channel identification: 89
    Interface identifier: Implicit
    Interface type: Basic
    Indicated channel: Exclusive
    D-channel identified: Yes
    Information channel selection: B1 channel
  ie 0x6C Calling party number: 21 83 36 38 35 39 34 32 30 31 39
    Number type: National number
    Numbering plan: ISDN/Telephony(CCITT Recommendation E.164/E.163)
    Presentation: presentation allowed
    Screening: network provided
    Number: 685942019
  ie 0x70 Called party number: A1 33 38 35 32 39 31 38 34 35
    Number type: National number
    Numbering plan: ISDN/Telephony(CCITT Recommendation E.164/E.163)
    Number: 385291845
ISDN3_00072 11/04 10:51:49 TX d_channel: 41 (S:00 T:000) payload: (4) 08 01 B5 02
0x02 CALL_PROCEEDING Ref: D,53
ISDN3_00077 11/04 10:51:49 TX d_channel: 41 (S:00 T:000) payload: (4) 08 01 B5 01
0x01 ALERTING Ref: D,53
ISDN3_00081 11/04 10:51:50 TX d_channel: 41 (S:00 T:000) payload: (17) 08 01 B5 07 4C 0B 21 81 33 38 35 32 39 31 38 34 34
0x07 CONNECT Ref: D,53
  ie 0x4C: 21 81 33 38 35 32 39 31 38 34 34
ISDN3_00082 11/04 10:51:50 RX d_channel: 41 (S:00 T:000) payload: (4) 08 01 35 0F
0x0F CONNECT_ACK Ref: O,53
ISDN3_00138 11/04 10:52:00 TX d_channel: 41 (S:00 T:000) payload: (8) 08 01 B5 45 08 02 85 90
0x45 DISCONNECT Ref: D,53
  ie 0x08 Cause: 85 90
    Coding: CCITT standardized
    Location: Private network serving the remote user
    Class: Normal event
    Value: Normal release
ISDN3_00147 11/04 10:52:00 RX d_channel: 41 (S:00 T:000) payload: (4) 08 01 35 4D
0x4D RELEASE Ref: O,53
ISDN3_00148 11/04 10:52:00 TX d_channel: 41 (S:00 T:000) payload: (4) 08 01 B5 5A
0x5A RELEASE_COMP Ref: D,53
 
 

Reply

Marsh Posté le 17-04-2019 à 21:47:24   

Reply

Marsh Posté le 17-04-2019 à 22:15:22    

Bonjour,
 
Quelles sont les contraintes ? Quel environnement / langage, qu'est-ce qui attendu exactement en sortie, en entrée est-ce un fichier texte, quelle taille, etc. ?
Où est-ce que tu bloques ?
Que viennent faire les réfs dans cette histoire ? Ne suffit-il pas de trier les blocs délimités par les ISDN3 ?


---------------
C'est en écrivant n'importe quoi qu'on devient n'importe qui.
Reply

Marsh Posté le 17-04-2019 à 23:15:05    

C'est un fichier excel avec une seule colonne que je souhaite trier.
Je voudrais que toutes les Ref: "O" et "D",5 (en rouge) soient regroupées à la suite (avec le "bloc" qui est en liaison avec cette Ref, c'est a dire le bloc qui inclue la ligne "ISDN3" qui précède cet Ref, et qui va jusqu'a l'ISDN3" suivant.)
Ensuite pareil pour les Ref: "O" et "D",53
Et ainsi de suite

Reply

Marsh Posté le 18-04-2019 à 09:10:27    

Oui mais si tu tries les ISDN3 par leur numéro, est-ce que ça ne trie pas en même temps par réf. ?


---------------
C'est en écrivant n'importe quoi qu'on devient n'importe qui.
Reply

Marsh Posté le 18-04-2019 à 09:50:03    

Non les lignes ISDN3 ne comportent aucune référence, seule la date et heure......Ou alors, si tu as une solution pour que dans excel, ou je n'ai qu'une seule colonne et ou chaque ligne  correspond à une cellule,
De transformer cela en une seule colonne, ou toutes les cellules commenceraient par ISDN3 (cela simplifierait la procedure pour la suite)

Reply

Marsh Posté le 18-04-2019 à 10:38:53    

Je ne comprends rien à ta structure de données. Mais du peu que je comprends il faut commencer par regrouper les différentes lignes en blocs, puis trier ces blocs en fonction du numéro d'ISDN3.


---------------
C'est en écrivant n'importe quoi qu'on devient n'importe qui.
Reply

Marsh Posté le 18-04-2019 à 11:04:28    

Tout a fait, il me faudrait juste regouper mes lignes en bloc commencant tous par 'IDN3'

Reply

Marsh Posté le 18-04-2019 à 12:16:17    

Si ton fichier n'est pas trop gros, tu peux boucler sur tes lignes en stockant dans un tableau chaque bloc :

Code :
  1. Pour les lignes allant de 1 jusqu'à nombre de lignes
  2.   si la ligne commence par ISDN3
  3.     mettre ligne dans indice suivant du tableau
  4.   sinon
  5.     concaténer la ligne avec le contenu de l'indice courant du tableau
  6.   fin si
  7. fin boucle Pour


 
Ensuite, soit tu pars sur un tableau à 2 dimensions, soit tu crées un second tableau dans lequel tu vas stocker les nombres qui suivent l'ISDN3. Tu peux extraire ce nombre avec les fonctions de string classiques ou par expression régulière en activant un module. Ensuite tu tries ces nombres par ordre croissant et fait correspondre le tri avec le contenu de ton tableau.


---------------
C'est en écrivant n'importe quoi qu'on devient n'importe qui.
Reply

Marsh Posté le 18-04-2019 à 14:06:41    

Tout n'est pas très parlant pour moi mais je vais voir

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed