I have a code to create a csv for my data query. However I have no idea on how to make it so I just can drag any file into it and then output the desired csv with the inputfilename.
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
(ECHO test, severity, regulations, result, category, description, remediation, cveLink, details, data, score, dataRowCount)>parsed.csv
(FOR /F "tokens=2 delims=;" %%A in (data.txt) DO (
SET /A "num+=1"
SET "data=!data!,%%A"
IF !num! EQU 12 (
ECHO !data:~2!
SET "num=0"
SET "data="
)
))>>parsed.csv
PAUSE
EXIT /B
I just want for example that I have different input files i.e: data120213.txt and serverdatacollection1234124.txt and it would output after draggint those files to the bat file.: data120213.csv and serverdatacollection1234124.csv