【.cmd】 バッチファイルスクリプト %15 【.bat】 (760レス)
【.cmd】 バッチファイルスクリプト %15 【.bat】 http://mevius.5ch.net/test/read.cgi/tech/1663153441/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
必死チェッカー(本家)
(べ)
自ID
レス栞
あぼーん
287: デフォルトの名無しさん [sage] 2023/05/10(水) 03:43:26.68 ID:fIRqc6o3 >>266 Ruby なら、 require 'json' # 改行を削除する。削除しなくても同じ結果 input_json_str = <<'JSON'.delete( "\n" ) [{"ID": 1,"Level": 50, "Status": {"idx":1}}, {"ID": 1,"Level": 100, "Status": {"idx":2}}, {"ID": 2,"Level": 50, "Status": {"idx":3}}, {"ID": 3,"Level": 50, "Status": {"idx":4}}, {"ID": 3,"Level": 100, "Status": {"idx":5}}] JSON input_json_obj = JSON.parse( input_json_str ) # ID でグループ化して、最大Level のものを取得する result = input_json_obj.group_by { |hash| hash[ "ID" ] }.map do |row| row[ 1 ].max_by { |hash| hash[ "Level" ] } end p result 出力 [ {"ID"=>1, "Level"=>100, "Status"=>{"idx"=>2}}, {"ID"=>2, "Level"=>50, "Status"=>{"idx"=>3}}, {"ID"=>3, "Level"=>100, "Status"=>{"idx"=>5}} ] http://mevius.5ch.net/test/read.cgi/tech/1663153441/287
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
1.224s*