Recursive Batch File
- by MCZ
I have a file that looks this:
head1,head2,head3,head4,head5,head6
a11,a12,keyA,a14,a15,a16
a21,a22,keyB,a24,a25
a31,a32,keyC,a34
a41,a42,keyB,a44,a44
a51,a52,keyA,a54,a55,a56
a61,a62,keyA,a64,a65,a66
a71,a72,keyC,a74
some message
Objective: Write list of unique keys to a text file. For example, the result for the file described above should be:
keyA, keyB, keyC
Here's the pseudocode I would like to implement in batch file recur.bat
Read second line of inputfile
If no key exist on second line, return
else continue
Append keyX to list
FINDSTR /v keyX inputfile
Pipe results to recur.bat
I don't know if this is the most efficient way to do this without using actual programming language.
Any suggestions for actual batch file code?