Solved

Looking for the best vbscript methode to read two column text file for parameter data from a text file for param value.

Posted on 2014-03-24
1
793 Views
Last Modified: 2014-03-31
Looking for the best vbscript methode to read two column text file for parameter data from a text file for param value. What to create a batch process for a vbscript update script. Script will need to loop each line update until complete. Looking at a two column text file of two column directory locations c:\test\qa1, c:\test\qa2.
0
Comment
Question by:williamfl
1 Comment
 
LVL 53

Accepted Solution

by:
Bill Prew earned 500 total points
ID: 39952024
Here's a simple example...

' Define I/O constants
Const ForReading = 1
Const ForWriting = 2

' Define constants for file to process, and pattern to match
Const strInFile = "c:\temp\control.csv"

' Open input file for processing
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objInFile = objFSO.OpenTextFile(strInFile, ForReading)

' Read each line and display all matches on that line
Do Until objInFile.AtEndOfStream
   strLine = objInFile.Readline
   arrField = Split(strLine, ",")
   Wscript.Echo "P1=" & arrField(0)
   Wscript.Echo "P2=" & arrField(1)
Loop

' Wrap up
objInFile.Close
Set objInFile = Nothing

Open in new window

~bp
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo‚Ķ
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question