98279a0b36
The current... attempt at an approach was broken and becoming horribly unmaintainable. Two issues found without even looking: 1. Field inference didn't understand prefixes, leading to duplicate by/field fields when attempting to infer by fields with --prefix. 2. Sort wasn't working for some reason, probably because they behavior of sort, defines, etc are really weird since they apply to both by fields and field fields. I considered just dropping support for --prefix completely, this really isn't worth the time, but instead found a simple solution of moving prefix handling to one of the first steps in collect_csv. This has the downside of creating conflicts when a prefixed/non-prefixed field has the same name, but I don't care. --prefix is a niche flag that shouldn't mess with the rest of the code like this, and none of the other scripts really handle field conflicts correctly anyways.