Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Win Server 2008: .bat to read and append/create new file files

Status
Not open for further replies.

goodmans

MIS
Joined
Apr 23, 2008
Messages
63
Location
GB
Hi,

Platform: Win Server 08

Requirement is
InputFile:
File1 Contents:
Row1: Col1_VALUE, Col2_Value, Col3_Value
Row2: Col1_VALUE, Col2_Value, Col3_Value
Row3: Col1_VALUE, Col2_Value, Col3_Value
Row4: Col1_VALUE, Col2_Value, Col3_Value

OutputFile: Loop No of rows in File1 (4)
(
Param1=<Col1_Value in Row1..4>
Param2=<Col2_Value in Row1..4>
Param3=<Col3_Value in Row1..4>
)

Script is to execute an exe file 4 times once for a row in Input file.

Please let me how i can achieve this. Will i be able to execute this using VBS? do i need to install any library to execute vbs. i am very new to this. I know how i can do this in Unix. using sed functionality. But dont know how to achieve this in windows. Please help.

Regards
Suresh
 
Is your goal to output the parameters to a file or use them to execute?

Here's the basic idea to split up the data
Code:
arrRows = array("1A, 2A, 3A", "1B, 2B, 3B", "1C, 2C, 3C")
for i = 0 to ubound(arr)
	arr(i) = split(arr(i), ",")
next

strParam = arr(1)(2)

-Geates

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top