Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Reading Text files


Message #1 by ashay@w... on Wed, 1 May 2002 12:07:23
hi,

thanx....got it......pretty simple.....
regds,
ashay

> 

--------------190988AE1EBC1DD24D3BA61C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

pl look into the following code ,


Open Filname For Input As #1  'open the text file

While Not EOF(1) 'loop through the contents
   Line Input #1, Strline
   lnno = lnno +1  'increment
  if lnno = 2 then    'stop at the second line
    msgbox mid(strline,7,3)
   endif
wend


ashay@w... wrote:

> hi,
> i want to read a text file.I will be provided with the line number and 
the
> column number of the data to be retrieved.
>
> Suppose this is the text file:
> Hello VB World
> Hello P2P how are you?
>
> Now i shud be able to retrieve "P2P" based on the following input
> linenumber=2
> columnnumber=7
> Length=3
>
> any help
>
> regds,
> ashay
>
> ---
> Change your mail options at http://p2p.wrox.com/manager.asp or
> to unsubscribe send a blank email to 

--------------190988AE1EBC1DD24D3BA61C
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
pl look into the following code ,
<br>&nbsp;
<p><b>Open Filname For Input As #1&nbsp; 'open the text file</b>
<br><b>&nbsp;</b>
<br><b>While Not EOF(1) 'loop through the contents</b>
<br><b>&nbsp;&nbsp; Line Input #1, Strline</b>
<br><b>&nbsp;&nbsp; lnno = lnno +1&nbsp; 'increment</b>
<br><b>&nbsp; if lnno = 2 then&nbsp;&nbsp;&nbsp; 'stop at the second 
line</b>
<br><b>&nbsp;&nbsp;&nbsp; msgbox mid(strline,7,3)</b>
<br><b>&nbsp;&nbsp; endif</b>
<br><b>wend</b>
<br>&nbsp;
<p>ashay@w... wrote:
<blockquote TYPE=CITE>hi,
<br>i want to read a text file.I will be provided with the line number
and the
<br>column number of the data to be retrieved.
<p>Suppose this is the text file:
<br>Hello VB World
<br>Hello P2P how are you?
<p>Now i shud be able to retrieve "P2P" based on the following input
<br>linenumber=2
<br>columnnumber=7
<br>Length=3
<p>any help
<p>regds,
<br>ashay
<p>---
<br>Change your mail options at <a 
href="http://p2p.wrox.com/manager.asp">http://p2p.wrox.com/manager.asp</a>
or
<br>to unsubscribe send a blank email to </blockquote>
</html>

--------------190988AE1EBC1DD24D3BA61C--


  Return to Index