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
762 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 51

Accepted Solution

by:
Bill Prew earned 500 total points
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

This article will show, step by step, how to integrate R code into a R Sweave document
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now