Reputation: 185
Once again I am attempting to parse through some 12+ .csv files to get an overall sum of fax pages sent. I have created a text file that lists all of the .csv files I wish to parse based on a range of dates...
logparser -i:fs "select Path into .\FaxReportNames.txt from *inbound_faxing*.csv where to_string(LastWriteTime,'yyyy-MM-dd') >= '2020-01-01'" -rtp:-1 -recurse:-1
Now I would like to use that list of files in another logparser query to sum the same column in all of the files. The goal is to get a total number of fax pages for that time range. I attempted to use logparser in conjunction with a batch job but that only parsed one file at a time.
for /f "skip=2" %%F in (FaxReportNames.txt) do (
echo %%F
logparser -i:csv "select sum(NUMPAGES) from '%%F%'"
)
I suppose I can take the for loop even further and concatenate all of the files into one large file but that seems just silly to do. Perhaps I am searching wrong but is there some way to parse the files from the list generated and get an overall sum?
I also foresee requests for break downs of the data per month so I will likely be referring to a date column within the files at some point as well...
Upvotes: 0
Views: 159