1) I have a criteria.txt
T501-08667-0102
T501-08696-0101
T501-08657-0101
2) I have another txt file (profile_scheme.txt) which has four column as below:
T501-08667-0100, T501-08680-0100, T501-08815-0100, T501-08665-0100
T501-08667-0101, T501-08680-0101, T501-08815-0101, T501-08665-0101
T501-08667-0102, T501-08680-0102, T501-08815-0102, T501-08665-0102
T501-08696-0100, T501-08699-0100, T501-08700-0100, T501-08666-0101
T501-08696-0101, T501-08699-0101, T501-08700-0101, T501-08666-0101
T501-08657-0100, T501-08690-0100, T501-08820-0100, T501-08664-0100
T501-08657-0101, T501-08690-0101, T501-08820-0101, T501-08664-0101
I have a code to get whole column, say column 3
Code: Select all
for /f "tokens=3 delims=, " %%a in (profile_scheme.txt) do (
echo%%a>>sch_pack_need.txt
)
T501-08815-0100
T501-08815-0101
T501-08815-0102
T501-08700-0100
T501-08700-0101
T501-08820-0100
T501-08820-0101
But what I want is to get 3 row values (in bold) from this column which is referencing from criteria.txt
T501-08815-0102
T501-08700-0101
T501-08820-0101
Thanks