I have a CSV file that has looks something like below:
Order ID,Order Date,Ship Date,Ship Mode
CA-2011-103800,2013-01-03,2013-01-07 00:00:00,Standard Class
CA-2011-112326,2013-01-04,2013-01-08 00:00:00,Standard Class
All I need is to get from first data row the order date, i.e. 2013-01-03 in this case.
I tried the code below which doesn't solve the problem.
set file=output.csv
for /f "skip=1 tokens=2 delims=," %%A in (%file%) do (echo %%A)
I am a beginner. Can anyone help me out with this?
:HaveValue(line with a label) and usefor /f "skip=1 tokens=2 delims=," %%A in (%file%) do set "OrderDate=%%A" & goto HaveValue. The line assigns the order date to the environment variableOrderDateand leaves the loop with a jump to line below the label line:HaveValue.