[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
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
Medium Priority
?
945 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 57

Accepted Solution

by:
Bill Prew earned 2000 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

Independent Software Vendors: 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

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

649 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