得到CSV最大百分比 [英] Get maximum percent from csv

查看:131
本文介绍了得到CSV最大百分比的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

subject score studentid
xx   23.22% 1
yy  34% 2
zz  55.2%   3
xx  88.66%  4
yy  23.76%  5
zz  78.04%  6

如何获得最大%和凭学生证每个主题?

How to get max % and student id for each subject?

推荐答案

您需要有某种形式的收集处理的总数为每个主题,这可能帮助

You'll need to have some sort of collection to handle the totals for each subject, this might help

@echo off 

  set CountXX=1
  set CountYY=2


  set This=XX
  call :Resolve Count%This%
  echo %RetVal%


  set This=YY
  call :Resolve Count%This%
  echo %RetVal%

  set /a Count%This%=%RetVal% + 2 

  call :Resolve Count%This%
  echo %RetVal%

goto :eof


:Resolve


  for /f "delims== tokens=2" %%a in ('set %1') do set retval=%%a

goto :eof

这篇关于得到CSV最大百分比的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆