 |
| View previous topic :: View next topic |
| Author |
Message |
izur Newbie
Joined: 10 Sep 2005 Posts: 2
|
Posted: Sep 10th, 2005 02:58 PM Post subject: Reading in line |
|
|
Hello all,
I am new here and also a beginner.
I need to read a file which contains float, but i want to read only the second strings of each line. I can read the line, but I have no idea to read only the second string.
Thanks for the answer.
Izp |
|
| Back to top |
|
izur Newbie
Joined: 10 Sep 2005 Posts: 2
|
Posted: Sep 10th, 2005 03:27 PM Post subject: Re: Reading in line |
|
|
For example, my txt file content:
&12
&11
&12,2
And I want to read from the second string only, which results:
12
11
12,2
That's it.
Thanks for the help! |
|
| Back to top |
|
DoobieKeebler Moderator

Joined: 17 Jun 2005 Posts: 254 Location: 181°15'2.003"W, 93°5'16.956"N
|
Posted: Sep 11th, 2005 03:19 PM Post subject: |
|
|
If strVariable is the line you're reading in, then to get everything but the first character then you'd say:
strVariable = Right(strVariable, Len(strVariable) - 1) _________________ Always take into account what a user would never ever in a million years do, because someone will.
"In theory, there's no difference between theory and practice. In practice, there is." -- Yogi Berra |
|
| Back to top |
|
VB_Developer Newbie
Joined: 25 Feb 2006 Posts: 18 Location: Hyderabad, India
|
Posted: Feb 27th, 2006 05:56 AM Post subject: |
|
|
Hi,
You can even Use fileSystemObject to create, delete, read and write files.
here is a example, how to read from a file using FileSystemObject.....
| Code: |
Sub ReadFiles
Dim fso, f1, ts, s
Const ForReading = 1
Set fso = CreateObject("Scripting.FileSystemObject")
Set f1 = fso.CreateTextFile("c:\testfile.txt", True)
' Write a line.
f1.WriteLine "Hello World"
f1.WriteBlankLines(1)
f1.Close
' Read the contents of the file.
Set ts = fso.OpenTextFile("c:\testfile.txt", ForReading)
s = ts.ReadLine
Response.Write "File contents = '" & s & "'"
ts.Close
End Sub
|
Hope, this will help you in solving the problems.....
Thanks
Deepak |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|