Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27193

VS 2010 Deleting space after 5 digits

$
0
0
Hello all,
I'm new to this forum but wanted to give this a shot.
I have a huge text file (if put into word is 182 pgs) that has a space after 5 digits that I need deleted.

An example of the data would be :
12345 Name Address Phone
01234 Name Address PHone
23456 Name Address Phone ect...

I need 6th character aka space deleted in bold ( 0 1 2 3 4 5 )

I have a little something that deletes all spaces, but i can't remember how to do a counter and delete a character after some many places.
Another one that i thought would work pretty much just copies from one txt to another:
Dim inputfile As String = "C:\test23.txt"
Dim outputfile As String = "C:\testnew.txt"
Dim textlines() As String = File.ReadAllLines(inputfile)
For i As Integer = 0 To textlines.Length - 1
textlines(i) = textlines(i).Replace(" ", "")
Next
File.WriteAllLines(outputfile, textlines)
File.Copy(inputfile, outputfile, True)

If anyone could help me out that would be great. If I'm not being that clear, just tell me and I will try to simplify :)
thanks,
llyd

Viewing all articles
Browse latest Browse all 27193

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>