Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1707 connectés 

  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  fichier texte avec doc xml

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

fichier texte avec doc xml

n°1651648
saks
Posté le 01-12-2007 à 11:02:15  profilanswer
 

je veux récupérer dans un fichier txt contenant des logs xml une trame complète
je fais :
 if(InStr(ligne , "<GA Name=""MSISDN" )) Then
    if (InStr(ligne,"Value=""+33"&msisdn)) Then
                                          wscript.echo "ligne:" + ligne
                                        end if
Le resultat :
ligne:          <GA Name="LGSM.MSISDN" Type="MSISDN" Value="+33664076187" />
 
Alors que la trame complète est :
 
<Request ID="{1111-000000000}" DATE="07/11/2007" TIME="03:00:13:448" >
<GO Name="LGSM.GetAlias" >
  <GA Name="MSISDN" Type="MSISDN" Value="+33664076187" />
 </GO>
 <GO Name="inParameters1" Type="inParameters" Id="0" >
  <GA Name="Alias.Type" Type="Alias.Type" Value="GWALIAS" />
 </GO>
</GO>
</Request>

mood
Publicité
Posté le 01-12-2007 à 11:02:15  profilanswer
 

n°1654507
pyrof
Posté le 07-12-2007 à 14:14:49  profilanswer
 

Voici une méthode
 
Sub xx()
 
Dim xx As String
Text = "<Request ID=""{1111-000000000}"" DATE=""07/11/2007"" TIME=""03:00:13:448"" ><GO Name=""LGSM.GetAlias"" >" _
 
Text = Text & "  <GA Name=""MSISDN"" Type=""MSISDN"" Value=""+33664076187"" />"
 
Text = Text & " </GO>"
Text = Text & " <GO Name=""inParameters1"" Type=""inParameters"" Id=""0"" >"
Text = Text & "  <GA Name=""Alias.Type"" Type=""Alias.Type"" Value=""GWALIAS"" />"
Text = Text & " </GO>"
Text = Text & "</GO>"
Text = Text & "</Request>"
 
text1 = "<GA Name=""MSISDN"
text2 = "Value=""+33"
 
pos1 = InStr(Text, text1)
tmp1 = Mid(Text, pos1)
pos2 = InStr(tmp1, ">" )
tmp2 = Left(tmp1, pos2)
 
If InStr(tmp2, text2) Then
    wscript = "ligne : " & tmp2
End If
 
 
End Sub
 
 
il y a surement plus simple mais ça fonctionne
 


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  fichier texte avec doc xml

 

Sujets relatifs
Lire un tableau de valeurs dans un fichier contenant aussi du texteExtraire une partie d'un fichier texte
Extraire de données de fichier texte vers excelexporter une bd access en fichier texte en vb6
[WSH Scripting] écrire dans fichier texte depuis fichier excel[VB6] : Supprimer le titre et numéro de page d'un fichier texte
Intégration de fichier texte dans Access en VBAsqlplus: pb format colonne dans un fichier texte issu d'une requête
recupérer un nombre dans un fichier texte grace a un Batc# problème formatage fichier texte
Plus de sujets relatifs à : fichier texte avec doc xml


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR