Please note that this macro assumes all CSV files are located in a directory call c:\Battest![]()
This Bat file will take ALL CSV files located in c:\Battest\*.csv and transfer any lines with value 60 or better to one file .... c:\Final.csv
:: ------------------ 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 %%6 GEQ 60 ECHO %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 >> c:\Final.csv
:: ------------------ Bat end here --------------------
PLEASE NOTE: That the from "FOR" to ">> c:\Final.csv" is ALL ON ONE LINE
The final CSV file is call "Final.csv" and is found at the root of C drive eg (C:\Final.csv) ........ OK ??![]()


LinkBack URL
About LinkBacks



Reply With Quote

Bookmarks