Dim Chaine As String Dim Splitage() As String Open App.Path & "\config.txt" For Input As #2 Chaine = StrConv(InputB(LOF(2), 2), vbUnicode) Close #2 Splitage() = Split(Chaine, vbCrLf) Text1.Text = UBound(Splitage()) + 1 & vbCrLf & Chaine
Do While Not EOF(1) ' Récupère la ligne de texte du 1er fichier Line Input #1, Tempo Dim nbrlig As Long Dim tem() As String Dim i As Long If Asc(Left$(Tempo, 1)) 45 Or Asc(Left$(Tempo, 1)) 9 Then Print #2, Tempo End If Loop Close #2 Open "H:\Surfin project of the fire\Charisma2Surfer\test01.bln" For Input As #2 Line Input #2, Tempo Do While Not EOF(2) nbrlig = 0 tem = Split(Tempo, Chr$(62)) For i = 0 To UBound(tem()) If Asc(Left$(tem(i), 1)) = 9 Then nbrlig = nbrlig + 1 Else Tempo = Replace(Tempo, , nbrlig & String(5, Chr$(9)), 1, 1) nbrlig = 0 End If Next Print #3, Tempo Loop
Dim Chaine As String Dim Splitage() As String Dim ChaineInter as String Dim i as Integer Open "H:\Surfin project of the fire\Charisma2Surfer\test01.bln" For Input As #2 Chaine = StrConv(InputB(LOF(2), 2), vbUnicode) Close #2 Splitage() = Split(Chaine, vbCrLf) ChaineInter = UBound(Splitage()) For i = 1 to UBound(Splitage()) ChaineInter = ChaineInter & VbCrLf & Splitage(i) Next i Text1.Text = ChaineInter
Do While Not EOF(2) nbrlig = 0 tem = Split(Tempo, Chr$(13)) For i = 0 To UBound(tem()) If Asc(Left$(tem(i), 1)) = 9 Then nbrlig = nbrlig + 1 If Asc(Left$(tem(i), 1)) = 45 Then Tempo = Replace(tem(i), nbrlig & String(5, "") & Chr$(13), 1, 1) nbrlig = 0 End If End If Next i loop Print #3, Tempo
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim Chaine As String Dim Splitage() As String Dim Splitage1() As String Dim ChaineInter As String Dim i As Integer Dim j As Integer Open "H:\Surfin project of the fire\Charisma2Surfer\test01.bln" For Input As #2 Chaine = StrConv(InputB(LOF(2), 2), vbUnicode) Close #2 Splitage() = Split(Chaine, "->") For i = 1 To UBound(Splitage()) '0 ou 1 suivant la recup du text avant le 1er comptage Splitage1() = Split(Splitage(i), vbCrLf) 'split les blocs ChaineInter = ChaineInter & (UBound(Splitage1()) - 1) & vbCrLf For j = 1 To UBound(Splitage1()) ChaineInter = ChaineInter & Splitage1(j) & vbCrLf Next j Next i Text1.Text = ChaineInter
Dim Chaine As String Dim Splitage() As String Dim Splitage1() As String Dim ChaineInter As String Dim i As Integer Dim j As Integer Open App.Path & "\config.txt" For Input As #2 Chaine = StrConv(InputB(LOF(2), 2), vbUnicode) Close #2 Splitage() = Split(Chaine, "->") For i = 1 To UBound(Splitage()) '0 ou 1 suivant la recup du text avant le 1er comptage Splitage1() = Split(Splitage(i), vbCrLf) 'split les blocs ChaineInter = ChaineInter & " " & (UBound(Splitage1()) - 1) & vbCrLf For j = 1 To UBound(Splitage1()) If j = UBound(Splitage1()) Then ChaineInter = ChaineInter & Splitage1(j) Else ChaineInter = ChaineInter & Splitage1(j) & vbCrLf End If Next j Next i Text1.Text = ChaineInter
dim Compte as integer dim Val,Val2 as integer dim ListCompte() as integer redim List(0) Compte = 0 For i = lbound(splitage()) to ubound(splitage()) Val = right(splitage(i), 2) if Val <> Val1 then ListCompte(ubound(ListCompte()-1) = compte redim preserve ListCompte(ubound(ListCompte()) compte = 1 Val2 = Val else Compte = compte +1 end if Next i 'Y'a plus qu'a recupérer le listCompte et le reinjecté dans le fichier
Dim Tempo As String Dim SurferApp As Object Static nb As Long Set SurferApp = GetObject(, "Surfer.application") Open SurferApp.Path & "\import Data\CharismaGeoframe Non Converted Data" & File2(23).FileName For Input As #1 'opens the file to import im reading mode Open SurferApp.Path & "\import Data\CharismaGeoframe Non Converted Data\tempG.bln" For Output As #2 Do While Not EOF(1) Line Input #1, Tempo If Asc(Left$(Tempo, 1)) = 83 Then 'if the first character is "S" Tempo = Mid$(Tempo, 47, 9) & "," & Mid$(Tempo, 55, 10) & Chr$(9) & Mid$(Tempo, 1, 10) Print #2, Tempo End If Loop Close #1 Close #2 Open SurferApp.Path & "\import Data\CharismaGeoframe Non Converted Data\tempG.bln" For Input As #2 Open SurferApp.Path & "\import Data\CharismaGeoframe Converted Data" & File3(33).FileName For Output As #3 Dim tempo2 As String Dim temp() As String Dim splitlig() As String Do While Not EOF(2) Line Input #2, tempo2 temp = Split(tempo2, Chr$(9)) tempo2 = Replace(Replace(Replace(tempo2, Chr$(9), String(3, Chr$(32))), temp(1), temp(1) & "0" & String(2, Chr$(32))), temp(2), temp(2) & "0" & String(4, Chr$(32))) 'adds the needed decimal zeros Print #3, tempo2 Loop Close #2 Close #3