Access2000: reading from text file

A

Arvi Laanemets

Hi

I need to read rows from text file. Here is an example from text file
contents (between *'s):
*
This file was generated by Angry IP Scanner
Visit http://www.angryziber.com/ for the latest version


Scanned 192.168.0.1 - 192.168.0.255
01.12.2004 11:01:27

IP Ping Hostname Comp. Name ...

192.168.0.1 0 ms Comp1 Comp1 ...
192.168.0.2 0 ms Comp2 Comp2 ...
*

I tried to use Input # to read data row-wise - look at code below:
....
Open strFullName For Input As #1
For i = 1 To n
Input #1, TempLine
Next
....

BUT: from row 6 on VBA is getting too helpful, and is trying to interpret
all data as numeric. I.e.

for n=6 instead "01.12.2004 11:01:27" the variable TempLine=1.12
for n=8 instead "IP Ping Hostname Comp.
Name ..." the variable TempLine=Null (of-course, because no numbers
there)
for n=10 instead "192.168.0.1 0 ms Comp1 Comp1
...." the variable TempLine=192.168
etc.

Is there some advice from somebody available?
Thanks in advance!
 
A

Arvi Laanemets

OK. The case is resolved!
Instead
Input #1, TempLine
I'd to use
Line Input #1, TempLine
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top