'returns a new string without accented characters
Private Sub RemoveAccents(s As String) As String
Dim normalizer As JavaObject
normalizer.InitializeStatic("java.text.Normalizer")
Dim n As String = normalizer.RunMethod("normalize", Array As Object(s, "NFD"))
Dim sb As StringBuilder
sb.Initialize
For i = 0 To n.Length - 1
If Regex.IsMatch("\p{InCombiningDiacriticalMarks}", n.CharAt(i)) = False Then
sb.Append(n.CharAt(i))
End If
Next
Return sb.ToString
End Sub
Sub Lecture
Tribu.Initialize
Reader.Initialize2(File.OpenInput(File.DirRootExternal, "/Download/base.ged"),"Windows-1252")
Ligne=Reader.Readline
Do While Ligne <> Null
Log(Ligne)
Ligne = Reader.ReadLine
If dt=1 Then
Individu=Ligne.substring(7)
TRi
NOMS
End If
If Ligne<>Null Then
lgmot=Ligne.Length
If lgmot<>0 Then
If Ligne.substring(lgmot-4)="INDI" Then
dt=1
Else If Ligne.SubString(lgmot-3)="FAM" Then
TF=TF+1
Else If Ligne.SubString2(2,5)="SEX" And Ligne.SubString(lgmot-1)="F" Then
Femmes=Femmes+1
Else If Ligne.SubString2(2,5)="SEX" And Ligne.SubString(lgmot-1)="M" Then
Hommes=Hommes+1
End If
End If
End If
Loop
Reader.Close
End Sub
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?