Batch programming and excel help

December 28, 2010 at 09:31:51
Specs: Windows XP
I want to have a batch program that asks for a store name. Once entered. I want it to check a spreadsheet of stores names with columns of IP addresses associated with that store #. I want it to search the spreadsheet for the store # and return the corresponding IP address. Is this possible? I'm new to batch programming. thanks for the patience.

See More: Batch programming and excel help

December 28, 2010 at 11:38:25
If you want to do it in Excel you will need a VBA program but if you want to do it in a batch script you will need to save the spread sheet to a flat file (CSV file) then you can write a loop that will go through until it finds the data you need like...

For /f "tokens=1,2,3,* delims=," %%a in (c:\mylist.csv) do (
  if %%b == %1 echo IP is %%c

%1 is the parameter you provided with the batch file i.e...

MyBatch AStoreName

%1 would hold AStoreName.

%%a is the first column, %%b the second and %%c the third. This all I can do with the info you provided. To really help I need a sample of the file you want to look at. Copy the first few lines and post.

Report •
Related Solutions

Ask Question