0

I want to read each and every line from my csv file in Batch file, Here I am searching for employeeid in D:\parameters.csv, and a csv file with that name should be present in the directory:

csv file content: Employee1,Alex Employee2,Tariq

and I want to search employee1.csv and employee2.csv in my directory

for /f "tokens=1 skip=1 delims=, " %%B in ('type "D:\Employeedata.csv"') do (
        if not exist D:\%%B.csv (
        echo Please Keep %%B.csv file at D:\

        )
    )

By Doing, I can find employee1.csv,employee2.csv from above code

How to check both files exists or not, If any one of the file does not exists in directory, I want to end the batch file

Aquaman
  • 43
  • 5
  • There are no rows in a CSV file. All there are, are records on each line, each containing one or more fields each separated by delimiters, traditionally a comma, _(hence the name Comma Separated Values) Please [edit] your question, to include the representative test content of your CSV, so that we can all work with the same code and content. When you use `GoTo :EOF`, your loop is ended, so that's the logical reason why all of your lines are not being processed. – Compo Feb 11 '21 at 13:55
  • If the first file is not found it exits your batch file. – Squashman Feb 11 '21 at 15:07
  • I have change the question contents,I wanted to end the Batch file ,if file with name in csv not found in directory – Aquaman Feb 12 '21 at 07:06

0 Answers0