' 'Replaces tabs for spaces and replaces multiple spaces for single spaces. ' Sub RemoveTabsnMultiSpaces(byref s As string) Dim i As integer For i = 1 To len(s) If GetAt(s,i) = chr(9) Then s = SetAt(s,i," ") End if Next For i = 1 To len(s)-1 If GetAt(s,i) = " " Then While GetAt(s,i+1) = " " s = setat(s,i+1,"") Wend End if Next WriteToFile s End Sub Function GetAt(s As string,i As Integer) As String GetAt = mid(s,i,1) End Function Function SetAt(byref s As string,iIndex As Integer,sR As string) Dim s1 As String Dim s2 As String s1 = mid(s,1,iIndex-1) s2 = right(s,len(s)-iIndex) SetAt = s1 + sR + s2 End Function