Count words in an external file using delimiter of a spaceHow to efficiently count the number of keys/properties of an object in JavaScript?Count the number occurrences of a character in a stringHow can I count the occurrences of a list item?C# List<string> to string with delimiterSplit string with multiple delimiters in PythonReading Input File and Putting It Into An Array with Space Delimiter in PerlReading files with multiple delimiters in c++counting characters and lines from a file python 2.7Java recursive method for counting wordsCounting the number of spaces between words in a file using python?
Why is the marginal distribution/marginal probability described as "marginal"?
Resistor Selection to retain same brightness in LED PWM circuit
Can I pay my credit card?
Thread.sleep inside infinite while loop doesn't throw exception - why?
How can I make dummy text (like lipsum) grey?
Assign the same string to multiple variables
Why is it correct to use ~た in this sentence, even though we're talking about next week?
Is Precocious Apprentice enough for Mystic Theurge?
Why do academics prefer Mac/Linux?
Why doesn't Iron Man's action affect this person in Endgame?
Why did the soldiers of the North disobey Jon?
Why use a retrograde orbit?
What would a Dragon have to exhale to cause rain?
When the match time is called, does the current turn end immediately?
Why are there five extra turns in tournament Magic?
How does this piece of code determine array size without using sizeof( )?
Polynomial division: Is this trick obvious?
A person lacking money who shows off a lot
What dog breeds survive the apocalypse for generations?
bash: Counting characters within multiple files
Do we see some Unsullied doing this in S08E05?
Can EU citizens work on Iceland?
Is Big Ben visible from the British museum?
Why didn't Daenerys' advisers suggest assassinating Cersei?
Count words in an external file using delimiter of a space
How to efficiently count the number of keys/properties of an object in JavaScript?Count the number occurrences of a character in a stringHow can I count the occurrences of a list item?C# List<string> to string with delimiterSplit string with multiple delimiters in PythonReading Input File and Putting It Into An Array with Space Delimiter in PerlReading files with multiple delimiters in c++counting characters and lines from a file python 2.7Java recursive method for counting wordsCounting the number of spaces between words in a file using python?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I want to calculate the number of words in a text file using a delimiter of a space (" "), however I am struggling.
Dim counter = 0
Dim delim = " "
Dim fields() As String
fields = Nothing
Dim line As String
line = Input
While (SR.EndOfStream)
line = SR.ReadLine()
End While
Console.WriteLine(vbLf & "Reading File.. ")
fields = line.Split(delim.ToCharArray())
For i = 0 To fields.Length
counter = counter + 1
Next
SR.Close()
Console.WriteLine(vbLf & "The word count is 0", counter)
I do not know how to open the file and to get the do this, very confused; would like an explanation so I can edit and understand from it.
vb.net count character delimiter
|
show 3 more comments
I want to calculate the number of words in a text file using a delimiter of a space (" "), however I am struggling.
Dim counter = 0
Dim delim = " "
Dim fields() As String
fields = Nothing
Dim line As String
line = Input
While (SR.EndOfStream)
line = SR.ReadLine()
End While
Console.WriteLine(vbLf & "Reading File.. ")
fields = line.Split(delim.ToCharArray())
For i = 0 To fields.Length
counter = counter + 1
Next
SR.Close()
Console.WriteLine(vbLf & "The word count is 0", counter)
I do not know how to open the file and to get the do this, very confused; would like an explanation so I can edit and understand from it.
vb.net count character delimiter
It looks like you will be able to use the first example in the StreamReader Class documentation to help you complete the code you have started.
– Andrew Morton
Mar 23 at 16:12
Or File.ReadAllText. You don't need to specify a delimiter if the delimiter is a space (char 32): it's the default separator. That's pretty much all you need.
– Jimi
Mar 23 at 16:14
@jimi, hi how would i do that the link you provided was in C im new to this so how would i write it inot VB
– loco3424
Mar 23 at 17:40
It's inC#,C++,F#andVB.Net. In the upper-right side of the page you can find the language selector.
– Jimi
Mar 23 at 17:47
@jimi Dim path As String = "z:test.txt" Dim length = Len(path) Console.WriteLine(length) , i did this is this correct not working
– loco3424
Mar 23 at 18:49
|
show 3 more comments
I want to calculate the number of words in a text file using a delimiter of a space (" "), however I am struggling.
Dim counter = 0
Dim delim = " "
Dim fields() As String
fields = Nothing
Dim line As String
line = Input
While (SR.EndOfStream)
line = SR.ReadLine()
End While
Console.WriteLine(vbLf & "Reading File.. ")
fields = line.Split(delim.ToCharArray())
For i = 0 To fields.Length
counter = counter + 1
Next
SR.Close()
Console.WriteLine(vbLf & "The word count is 0", counter)
I do not know how to open the file and to get the do this, very confused; would like an explanation so I can edit and understand from it.
vb.net count character delimiter
I want to calculate the number of words in a text file using a delimiter of a space (" "), however I am struggling.
Dim counter = 0
Dim delim = " "
Dim fields() As String
fields = Nothing
Dim line As String
line = Input
While (SR.EndOfStream)
line = SR.ReadLine()
End While
Console.WriteLine(vbLf & "Reading File.. ")
fields = line.Split(delim.ToCharArray())
For i = 0 To fields.Length
counter = counter + 1
Next
SR.Close()
Console.WriteLine(vbLf & "The word count is 0", counter)
I do not know how to open the file and to get the do this, very confused; would like an explanation so I can edit and understand from it.
vb.net count character delimiter
vb.net count character delimiter
edited Mar 23 at 19:49
Andrew Morton
16.3k63553
16.3k63553
asked Mar 23 at 16:01
loco3424loco3424
104
104
It looks like you will be able to use the first example in the StreamReader Class documentation to help you complete the code you have started.
– Andrew Morton
Mar 23 at 16:12
Or File.ReadAllText. You don't need to specify a delimiter if the delimiter is a space (char 32): it's the default separator. That's pretty much all you need.
– Jimi
Mar 23 at 16:14
@jimi, hi how would i do that the link you provided was in C im new to this so how would i write it inot VB
– loco3424
Mar 23 at 17:40
It's inC#,C++,F#andVB.Net. In the upper-right side of the page you can find the language selector.
– Jimi
Mar 23 at 17:47
@jimi Dim path As String = "z:test.txt" Dim length = Len(path) Console.WriteLine(length) , i did this is this correct not working
– loco3424
Mar 23 at 18:49
|
show 3 more comments
It looks like you will be able to use the first example in the StreamReader Class documentation to help you complete the code you have started.
– Andrew Morton
Mar 23 at 16:12
Or File.ReadAllText. You don't need to specify a delimiter if the delimiter is a space (char 32): it's the default separator. That's pretty much all you need.
– Jimi
Mar 23 at 16:14
@jimi, hi how would i do that the link you provided was in C im new to this so how would i write it inot VB
– loco3424
Mar 23 at 17:40
It's inC#,C++,F#andVB.Net. In the upper-right side of the page you can find the language selector.
– Jimi
Mar 23 at 17:47
@jimi Dim path As String = "z:test.txt" Dim length = Len(path) Console.WriteLine(length) , i did this is this correct not working
– loco3424
Mar 23 at 18:49
It looks like you will be able to use the first example in the StreamReader Class documentation to help you complete the code you have started.
– Andrew Morton
Mar 23 at 16:12
It looks like you will be able to use the first example in the StreamReader Class documentation to help you complete the code you have started.
– Andrew Morton
Mar 23 at 16:12
Or File.ReadAllText. You don't need to specify a delimiter if the delimiter is a space (char 32): it's the default separator. That's pretty much all you need.
– Jimi
Mar 23 at 16:14
Or File.ReadAllText. You don't need to specify a delimiter if the delimiter is a space (char 32): it's the default separator. That's pretty much all you need.
– Jimi
Mar 23 at 16:14
@jimi, hi how would i do that the link you provided was in C im new to this so how would i write it inot VB
– loco3424
Mar 23 at 17:40
@jimi, hi how would i do that the link you provided was in C im new to this so how would i write it inot VB
– loco3424
Mar 23 at 17:40
It's in
C#, C++, F# and VB.Net. In the upper-right side of the page you can find the language selector.– Jimi
Mar 23 at 17:47
It's in
C#, C++, F# and VB.Net. In the upper-right side of the page you can find the language selector.– Jimi
Mar 23 at 17:47
@jimi Dim path As String = "z:test.txt" Dim length = Len(path) Console.WriteLine(length) , i did this is this correct not working
– loco3424
Mar 23 at 18:49
@jimi Dim path As String = "z:test.txt" Dim length = Len(path) Console.WriteLine(length) , i did this is this correct not working
– loco3424
Mar 23 at 18:49
|
show 3 more comments
3 Answers
3
active
oldest
votes
You're going to be reading a file as the source of the data, so let's create a variable to refer to its filename:
Dim srcFile = "C:temptwolines.txt"
As you have shown already, a variable is needed to hold the number of words found:
Dim counter = 0
To read from the file, a StreamReader will do the job. Now, we look at the documenation for it (yes, really) and notice that it has a Dispose method. That means that we have to explicitly dispose of it after we've used it to make sure that no system resources are tied up until the computer is next rebooted (e.g there could be a "memory leak"). Fortunately, there is the Using construct to take care of that for us:
Using sr As New StreamReader(srcFile)
And now we want to iterate over the content of the file line-by-line until the end of the file:
While Not sr.EndOfStream
Then we want to read a line and find how many items separated by spaces it has:
counter += sr.ReadLine().Split(" "c, StringSplitOptions.RemoveEmptyEntries).Length
The += operator is like saying "add n to a" instead of saying "a = a + n". The " "c is a literal array of the character " "c. The c tells it that is a character and not a string of one character. The StringSplitOptions.RemoveEmptyEntries means that if there was text of "one two" then it would ignore the extra spaces.
So, if you were writing a console program, it might look like:
Imports System.IO
Module Module1
Sub Main()
Dim srcFile = "C:temptwolines.txt"
Dim counter = 0
Using sr As New StreamReader(srcFile)
While Not sr.EndOfStream
counter += sr.ReadLine().Split(" "c, StringSplitOptions.RemoveEmptyEntries).Length
End While
End Using
Console.WriteLine(counter)
Console.ReadLine()
End Sub
End Module
Any embellishments such as writing out what the number represents or error checking are left up to you.
add a comment |
With Path.Combine you don't have to worry about where the slashes or back slashes go. You can get the path of special folders easily using the Environment class. The File class of System.IO is shared so you don't have to create an instance.
Public Sub Main()
Dim p As String = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Chapters.txt")
Debug.Print(Environment.SpecialFolder.MyDocuments.ToString)
Dim count As Integer = GetCount(p)
Console.WriteLine(count)
Console.ReadKey()
End Sub
Private Function GetCount(Path As String) As Integer
Dim s = File.ReadAllText(Path)
Return s.Split().Length
End Function
add a comment |
Use Split function, then Directly get the length of result array and add 1 to it.
1
The OP has that part done, it is the "i do not know how to open the file" part which is the problem.
– Andrew Morton
Mar 23 at 16:47
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55315643%2fcount-words-in-an-external-file-using-delimiter-of-a-space%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
You're going to be reading a file as the source of the data, so let's create a variable to refer to its filename:
Dim srcFile = "C:temptwolines.txt"
As you have shown already, a variable is needed to hold the number of words found:
Dim counter = 0
To read from the file, a StreamReader will do the job. Now, we look at the documenation for it (yes, really) and notice that it has a Dispose method. That means that we have to explicitly dispose of it after we've used it to make sure that no system resources are tied up until the computer is next rebooted (e.g there could be a "memory leak"). Fortunately, there is the Using construct to take care of that for us:
Using sr As New StreamReader(srcFile)
And now we want to iterate over the content of the file line-by-line until the end of the file:
While Not sr.EndOfStream
Then we want to read a line and find how many items separated by spaces it has:
counter += sr.ReadLine().Split(" "c, StringSplitOptions.RemoveEmptyEntries).Length
The += operator is like saying "add n to a" instead of saying "a = a + n". The " "c is a literal array of the character " "c. The c tells it that is a character and not a string of one character. The StringSplitOptions.RemoveEmptyEntries means that if there was text of "one two" then it would ignore the extra spaces.
So, if you were writing a console program, it might look like:
Imports System.IO
Module Module1
Sub Main()
Dim srcFile = "C:temptwolines.txt"
Dim counter = 0
Using sr As New StreamReader(srcFile)
While Not sr.EndOfStream
counter += sr.ReadLine().Split(" "c, StringSplitOptions.RemoveEmptyEntries).Length
End While
End Using
Console.WriteLine(counter)
Console.ReadLine()
End Sub
End Module
Any embellishments such as writing out what the number represents or error checking are left up to you.
add a comment |
You're going to be reading a file as the source of the data, so let's create a variable to refer to its filename:
Dim srcFile = "C:temptwolines.txt"
As you have shown already, a variable is needed to hold the number of words found:
Dim counter = 0
To read from the file, a StreamReader will do the job. Now, we look at the documenation for it (yes, really) and notice that it has a Dispose method. That means that we have to explicitly dispose of it after we've used it to make sure that no system resources are tied up until the computer is next rebooted (e.g there could be a "memory leak"). Fortunately, there is the Using construct to take care of that for us:
Using sr As New StreamReader(srcFile)
And now we want to iterate over the content of the file line-by-line until the end of the file:
While Not sr.EndOfStream
Then we want to read a line and find how many items separated by spaces it has:
counter += sr.ReadLine().Split(" "c, StringSplitOptions.RemoveEmptyEntries).Length
The += operator is like saying "add n to a" instead of saying "a = a + n". The " "c is a literal array of the character " "c. The c tells it that is a character and not a string of one character. The StringSplitOptions.RemoveEmptyEntries means that if there was text of "one two" then it would ignore the extra spaces.
So, if you were writing a console program, it might look like:
Imports System.IO
Module Module1
Sub Main()
Dim srcFile = "C:temptwolines.txt"
Dim counter = 0
Using sr As New StreamReader(srcFile)
While Not sr.EndOfStream
counter += sr.ReadLine().Split(" "c, StringSplitOptions.RemoveEmptyEntries).Length
End While
End Using
Console.WriteLine(counter)
Console.ReadLine()
End Sub
End Module
Any embellishments such as writing out what the number represents or error checking are left up to you.
add a comment |
You're going to be reading a file as the source of the data, so let's create a variable to refer to its filename:
Dim srcFile = "C:temptwolines.txt"
As you have shown already, a variable is needed to hold the number of words found:
Dim counter = 0
To read from the file, a StreamReader will do the job. Now, we look at the documenation for it (yes, really) and notice that it has a Dispose method. That means that we have to explicitly dispose of it after we've used it to make sure that no system resources are tied up until the computer is next rebooted (e.g there could be a "memory leak"). Fortunately, there is the Using construct to take care of that for us:
Using sr As New StreamReader(srcFile)
And now we want to iterate over the content of the file line-by-line until the end of the file:
While Not sr.EndOfStream
Then we want to read a line and find how many items separated by spaces it has:
counter += sr.ReadLine().Split(" "c, StringSplitOptions.RemoveEmptyEntries).Length
The += operator is like saying "add n to a" instead of saying "a = a + n". The " "c is a literal array of the character " "c. The c tells it that is a character and not a string of one character. The StringSplitOptions.RemoveEmptyEntries means that if there was text of "one two" then it would ignore the extra spaces.
So, if you were writing a console program, it might look like:
Imports System.IO
Module Module1
Sub Main()
Dim srcFile = "C:temptwolines.txt"
Dim counter = 0
Using sr As New StreamReader(srcFile)
While Not sr.EndOfStream
counter += sr.ReadLine().Split(" "c, StringSplitOptions.RemoveEmptyEntries).Length
End While
End Using
Console.WriteLine(counter)
Console.ReadLine()
End Sub
End Module
Any embellishments such as writing out what the number represents or error checking are left up to you.
You're going to be reading a file as the source of the data, so let's create a variable to refer to its filename:
Dim srcFile = "C:temptwolines.txt"
As you have shown already, a variable is needed to hold the number of words found:
Dim counter = 0
To read from the file, a StreamReader will do the job. Now, we look at the documenation for it (yes, really) and notice that it has a Dispose method. That means that we have to explicitly dispose of it after we've used it to make sure that no system resources are tied up until the computer is next rebooted (e.g there could be a "memory leak"). Fortunately, there is the Using construct to take care of that for us:
Using sr As New StreamReader(srcFile)
And now we want to iterate over the content of the file line-by-line until the end of the file:
While Not sr.EndOfStream
Then we want to read a line and find how many items separated by spaces it has:
counter += sr.ReadLine().Split(" "c, StringSplitOptions.RemoveEmptyEntries).Length
The += operator is like saying "add n to a" instead of saying "a = a + n". The " "c is a literal array of the character " "c. The c tells it that is a character and not a string of one character. The StringSplitOptions.RemoveEmptyEntries means that if there was text of "one two" then it would ignore the extra spaces.
So, if you were writing a console program, it might look like:
Imports System.IO
Module Module1
Sub Main()
Dim srcFile = "C:temptwolines.txt"
Dim counter = 0
Using sr As New StreamReader(srcFile)
While Not sr.EndOfStream
counter += sr.ReadLine().Split(" "c, StringSplitOptions.RemoveEmptyEntries).Length
End While
End Using
Console.WriteLine(counter)
Console.ReadLine()
End Sub
End Module
Any embellishments such as writing out what the number represents or error checking are left up to you.
edited Mar 23 at 19:50
answered Mar 23 at 19:39
Andrew MortonAndrew Morton
16.3k63553
16.3k63553
add a comment |
add a comment |
With Path.Combine you don't have to worry about where the slashes or back slashes go. You can get the path of special folders easily using the Environment class. The File class of System.IO is shared so you don't have to create an instance.
Public Sub Main()
Dim p As String = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Chapters.txt")
Debug.Print(Environment.SpecialFolder.MyDocuments.ToString)
Dim count As Integer = GetCount(p)
Console.WriteLine(count)
Console.ReadKey()
End Sub
Private Function GetCount(Path As String) As Integer
Dim s = File.ReadAllText(Path)
Return s.Split().Length
End Function
add a comment |
With Path.Combine you don't have to worry about where the slashes or back slashes go. You can get the path of special folders easily using the Environment class. The File class of System.IO is shared so you don't have to create an instance.
Public Sub Main()
Dim p As String = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Chapters.txt")
Debug.Print(Environment.SpecialFolder.MyDocuments.ToString)
Dim count As Integer = GetCount(p)
Console.WriteLine(count)
Console.ReadKey()
End Sub
Private Function GetCount(Path As String) As Integer
Dim s = File.ReadAllText(Path)
Return s.Split().Length
End Function
add a comment |
With Path.Combine you don't have to worry about where the slashes or back slashes go. You can get the path of special folders easily using the Environment class. The File class of System.IO is shared so you don't have to create an instance.
Public Sub Main()
Dim p As String = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Chapters.txt")
Debug.Print(Environment.SpecialFolder.MyDocuments.ToString)
Dim count As Integer = GetCount(p)
Console.WriteLine(count)
Console.ReadKey()
End Sub
Private Function GetCount(Path As String) As Integer
Dim s = File.ReadAllText(Path)
Return s.Split().Length
End Function
With Path.Combine you don't have to worry about where the slashes or back slashes go. You can get the path of special folders easily using the Environment class. The File class of System.IO is shared so you don't have to create an instance.
Public Sub Main()
Dim p As String = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Chapters.txt")
Debug.Print(Environment.SpecialFolder.MyDocuments.ToString)
Dim count As Integer = GetCount(p)
Console.WriteLine(count)
Console.ReadKey()
End Sub
Private Function GetCount(Path As String) As Integer
Dim s = File.ReadAllText(Path)
Return s.Split().Length
End Function
answered Mar 24 at 2:00
MaryMary
4,5112921
4,5112921
add a comment |
add a comment |
Use Split function, then Directly get the length of result array and add 1 to it.
1
The OP has that part done, it is the "i do not know how to open the file" part which is the problem.
– Andrew Morton
Mar 23 at 16:47
add a comment |
Use Split function, then Directly get the length of result array and add 1 to it.
1
The OP has that part done, it is the "i do not know how to open the file" part which is the problem.
– Andrew Morton
Mar 23 at 16:47
add a comment |
Use Split function, then Directly get the length of result array and add 1 to it.
Use Split function, then Directly get the length of result array and add 1 to it.
answered Mar 23 at 16:22
Saumitra TopinkattiSaumitra Topinkatti
395
395
1
The OP has that part done, it is the "i do not know how to open the file" part which is the problem.
– Andrew Morton
Mar 23 at 16:47
add a comment |
1
The OP has that part done, it is the "i do not know how to open the file" part which is the problem.
– Andrew Morton
Mar 23 at 16:47
1
1
The OP has that part done, it is the "i do not know how to open the file" part which is the problem.
– Andrew Morton
Mar 23 at 16:47
The OP has that part done, it is the "i do not know how to open the file" part which is the problem.
– Andrew Morton
Mar 23 at 16:47
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55315643%2fcount-words-in-an-external-file-using-delimiter-of-a-space%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It looks like you will be able to use the first example in the StreamReader Class documentation to help you complete the code you have started.
– Andrew Morton
Mar 23 at 16:12
Or File.ReadAllText. You don't need to specify a delimiter if the delimiter is a space (char 32): it's the default separator. That's pretty much all you need.
– Jimi
Mar 23 at 16:14
@jimi, hi how would i do that the link you provided was in C im new to this so how would i write it inot VB
– loco3424
Mar 23 at 17:40
It's in
C#,C++,F#andVB.Net. In the upper-right side of the page you can find the language selector.– Jimi
Mar 23 at 17:47
@jimi Dim path As String = "z:test.txt" Dim length = Len(path) Console.WriteLine(length) , i did this is this correct not working
– loco3424
Mar 23 at 18:49