I´d like to know if somebody could help me with a problem here.
So, I´ve a .txt file and it has around 5000 lines full of numbers, and I need writing in certains lines some values, in that lines I need reading certains positions/columns, and later writing other values at the same place where that I took of the other...I´ll try to be a little more clear ok:
Example of my .txt file
and in that way, till the end of document...
so, you see the bold numbers ? that is the ones that I need read and later write other values at the same position, I think it would be something like an "update", but in a .txt file...:D
So, I can read the entire document using the streamreader, it would be something like....
Dim arquivoTexto As String
Dim leitor As StreamReader = File.OpenText(nomeArquivo)
arquivoTexto = leitor.ReadToEnd
however, I´d like to know if there´s a way to read just certains lines from my .txt file and not the whole file, something that works like a index or kinda of that, cause the lines that I need to read will be always the same, the only thing that will change will be the values, So, if I can get the line that I want, I can take the numbers I want through a simple subString right... ?
my problem is....take that lines !!!
the second part of my problem is: how to write in .txt, the numbers I changed at the same positions where the other have been...
original .txt file line 0 = 123456798
.txt file after alteration line 0 = 123499798
summarizing, I know exactly the lines and columns where the numbers that I need to modify will be, I just dont know how to get that lines/colums, and dont know too how to write the new numbers at the right positions.... :/
*** I never will need writing 2 numbers and then write 3 for example, if I read 2, just 2 will be modified...
Wow, I hope it was the more possible clearing...really I did try ;)
sorry for any english mistakes.....I´m brazilian guy, trying to learn english language :)
Since, thanks any help
hugs 4 all