As long as each file is a different source withing Splunk, you can:
your_search_for_files | eval has_error = if(match(_raw, "Error"),1,0)| stats sum(has_error) by source
If you want to get the number of Errors per transaction within a source, try this (UNIQ_ID_FIELD refers to the field with the individual transaction id in it):
your_search_for_files | eval has_error = if(match(_raw, "Error"),1,0)| transaction startswith="Start" endswith="Success" source | stats sum(has_error) by UNIQ_ID_FIELD
... View more