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
876 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 55

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 …
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.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

691 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