[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
  1. <# :
  2. cls&echo off&cd /d "%~dp0"&rem 编码ANSI
  3. powershell -NoProfile -ExecutionPolicy bypass "[IO.File]::ReadAllText(\"%~f0\",[Text.Encoding]::GetEncoding('GB2312'))|Invoke-Expression"
  4. pause
  5. exit
  6. #>
  7. $csvfile=".\记录.csv";
  8. if(-not (test-path -literal $csvfile)){write-host ('"'+$csvfile+'" 未找到');exit;}
  9. $enc=[Text.Encoding]::GetEncoding('UTF-8');
  10. $text=[IO.File]::ReadAllLines($csvfile, $enc);
  11. if($text.count -ge 3){
  12.     $arr=@($text[1..($text.count -1)]|sort {$_.split(',')[6]} -Descending);
  13.     $newtext=$text[0]+"`r`n"+($arr -join "`r`n");
  14.     [IO.File]::WriteAllText($csvfile, $newtext, $enc);
  15. }
复制代码
提供bat代写,为你省时省力省事,支付宝扫码头像支付
微信: unique2random

TOP

返回列表