Quantcast
Channel: Eliminando espaços em branco
Viewing all articles
Browse latest Browse all 2

Eliminando espaços em branco

$
0
0
Exibo em uma listbox, um arquivo txt de nome

desejo que quando a  não houver nome, ou seja, quando a linha for em branco
ele nao escreva  linha em branco

estou lendo o arquivo desta forma e não da certo



 ListBox1.Items.Clear()


        Dim objtextfile, objFSO As Object
        Dim sReadline As Object
        Dim ForReading, ForWriting As Integer

        ForReading = 1
        ForWriting = 2

        'leitura do list1
        objFSO = CreateObject("Scripting.FileSystemObject")
        objtextfile = objFSO.OpenTextFile(pastafinal & "lista.txt", ForReading)

        'vou percorrer todos os itens do list1
        While Not objtextfile.AtEndofStream = True
            sReadline = objtextfile.ReadLine

            ListBox1.Items.Add(sReadline)
        End While
        ListBox1.Sorted = SortOrder.Descending


        objtextfile.close()


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles



Latest Images