Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
968 views
in Technique[技术] by (71.8m points)

automated tests - Merge duplicate results, average them and generate one CSV file

I'm looking for an approach of the following situation:

I am producing data for test runs in our laboratory.

The samples are measured in duplicate, every measurement generates a .CSV-file. The output name will be something like:

  • 10891234.csv
  • 10891234 duplo.csv
  • 10891234 a/b .csv
  • 10891234 1/2 .csv

The data it contains:

component,mass%,area,calc
C6:0,<0.1,n.a.,0.0000
C7:0,<0.1,0.031,0.0076
C8:0,<0.1,0.209,0.0514
C9:0,<0.1,n.a.,0.0000
C10:0,<0.1,0.270,0.0665
C11:0,<0.1,n.a.,0.0000
C12:0,0.3,1.224,0.3010

and 40 more rows

The two files needs to be merged and averged, where the final output needs to be at least row a and b (component/mass%). Row D, calc, contains the unrounded values, every component needs to be rounded to 1 decimal, or if below 0.1 it needs to be reported as "<0.1".

The software which generates the results is able to run a program like .bat-files. I've been programming some macro's in Excel, where you would have to paste the files, and then it averages; but this still is something that can be automated.. just not sure how I approach this.

question from:https://stackoverflow.com/questions/65890455/merge-duplicate-results-average-them-and-generate-one-csv-file

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...