Jump to content

Recommended Posts

Posted

Boas..

Tou aqui com uma duvida em vb 2010.

Tenho um ficheiro de texto imaginemos neste formato

#lalal

#lalal

#lalal

#lalal

312412414,51413414,3141343141,431423423423,423423423423,4234234234

234324234234,2342342343242,4324234234234,23423432432,4234234234234

2,34234234234,32423423432,42344234234,2342342342342,4234234234,234

Como digo para apenas começar a ler a partir da 5 linha neste caso ?

Para ignorar as primeiras 4 linhas..

Obrigado!

Posted

Parece-me que o que queres é ignorar linhas começadas por cardinal 🙂

Algo como:

Using SR As New IO.StreamReader("ficheiro.txt")
   While Not SR.EndOfStream
       Dim tmpLinha As String = SR.ReadLine
       If Not tmpLinha.StartsWith("#") Then
           'tmpLinha tem a linha sem cardinal
       End If
   End While
End Using

Sérgio Ribeiro


"Great coders aren't born. They're compiled and released"
"Expert coders do not need a keyboard. They just throw magnets at the RAM chips"

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.