  | | | VB script file input | VB script file input 2004-02-12 - By Andy Hayes
Back You have to use a filesystem object, and then you can open the file from that ( where in this case 'path' is a variable that holds the filename)
set oFS = CreateObject("Scripting.FileSystemObject") set oFile = oFS.OpenTextFile(path,1,1)
to simply read in data use readline method from the file object:
data = oFile.ReadLine
andy -- --Original Message-- -- From: owner-xsi@(protected) [mailto:owner-xsi@(protected)]On Behalf Of duncan_burch@(protected) Sent: 12 February 2004 15:19 To: XSI@(protected) Subject: VB script file input
Hi guys, Anyone help me out with a simple question.
In vbscript i want to be able to read in a sequence of numbers from a text file. Any clues.
Ta all Dunk
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859 (See http://iso-8859.ora-code.com)-1"> <META content="MSHTML 6.00.2800.1400" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff> <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=165133915-12022004>You have to use a filesystem object, and then you can open the file from that ( where in this case 'path' is a variable that holds the filename)</SPAN></FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=165133915-12022004></SPAN></FONT> </DIV> <DIV><FONT face=Arial color=#0000ff size=2>set oFS = CreateObject("Scripting.FileSystemObject")<BR>set oFile = oFS.OpenTextFile(path,1,1)</FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV> <DIV><SPAN class=165133915-12022004><FONT face=Arial color=#0000ff size=2>to simply read in data use readline method from the file object:</FONT></SPAN></DIV> <DIV><SPAN class=165133915-12022004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN class=165133915-12022004>data = </SPAN>oFile.ReadLine</FONT></FONT></FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV> <DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV> <DIV><SPAN class=165133915-12022004><FONT face=Arial color=#0000ff size=2>andy</FONT></SPAN></DIV> <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"> <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma size=2>-- --Original Message-- --<BR><B>From:</B> owner-xsi@(protected) [mailto:owner-xsi@(protected)]<B>On Behalf Of </B>duncan_burch@(protected)<BR><B>Sent:</B> 12 February 2004 15:19<BR><B>To:</B> XSI@(protected)<BR><B>Subject:</B> VB script file input<BR><BR></FONT></DIV> <DIV><FONT face=Arial size=2>Hi guys,</FONT></DIV> <DIV><FONT face=Arial size=2>Anyone help me out with a simple question.</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>In vbscript i want to be able to read in a sequence of numbers from a text file.</FONT></DIV> <DIV><FONT face=Arial size=2>Any clues.</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>Ta all</FONT></DIV> <DIV><FONT face=Arial size=2>Dunk</FONT></DIV></BLOCKQUOTE></BODY></HTML>
|
|
 |