This is a shot in the dark. I haven't tested it:
:: ------------------ BAT start here -----------
@echo off
del c:\Total.csv
Del c:\Final.csv
Type c:\BATTEST\*.CSV > c:\Total.csv
FOR /F "eol=- delims=~ tokens=1-5,6,7*" %%1 IN ( c:\Total.CSV ) DO IF %%4 EQ 456 ECHO %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 >> c:\Final.csv
FOR /F "eol=- delims=~ tokens=1-5,6,7*" %%1 IN ( c:\Total.CSV ) DO IF %%4 EQ 987 ECHO %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 >> c:\Final.csv
FOR /F "eol=- delims=~ tokens=1-5,6,7*" %%1 IN ( c:\Total.CSV ) DO IF %%4 EQ 654 ECHO %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 >> c:\Final.csv
FOR /F "eol=- delims=~ tokens=1-5,6,7*" %%1 IN ( c:\Total.CSV ) DO IF %%4 EQ 123 ECHO %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 >> c:\Final.csv
:: ------------------ Bat end here --------------------
A few assumptions this makes:
- your file has 8 fields in it, never more.
- your source files are located in C:\BATTEST
If it works, your output file will be in C:\Final.csv. If your file has fewer fields in it, then there are a few things that would need to be changed.