Skip to content

Instantly share code, notes, and snippets.

@CNA-Bld
Last active June 17, 2021 21:56
Show Gist options
  • Save CNA-Bld/5b475cb46c7d407fa69a528e448972ab to your computer and use it in GitHub Desktop.
Save CNA-Bld/5b475cb46c7d407fa69a528e448972ab to your computer and use it in GitHub Desktop.
CarrotJuicer cleanup for TeamRaceAnalyzer
$files = Get-ChildItem -Include *.msgpack -Name
$teamRaces = $files | Where-Object {($_ -match "R.msgpack") -and (Get-Content $_ -Raw | %{($_ -match "race_start_params_array") -and ($_ -match "race_result_array")})}
New-Item -Path .\TeamRaces -ItemType directory -Force
Copy-Item $teamRaces -Destination .\TeamRaces\
$roomRaces = $files | Where-Object {($_ -match "R.msgpack") -and (Get-Content $_ -Raw | %{($_ -match "room_info") -and ($_ -match "race_horse_data_array")})}
New-Item -Path .\RoomRaces -ItemType directory -Force
Copy-Item $roomRaces -Destination .\RoomRaces\
New-Item -Path .\Backup -ItemType directory -Force
Move-Item $files -Destination .\Backup\
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment