Created
October 25, 2021 02:42
-
-
Save ebibibi/7f1aa45dfc0ff0967889f72110e27548 to your computer and use it in GitHub Desktop.
Adobe Premiereのマーカーをエクスポートしたテキストファイルを元にYoutubeのインデックスを作成するPowerShellスクリプト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$targetFileName = "Ending_60p.txt" | |
$desktop = [Environment]::GetFolderPath("Desktop") | |
$targetFile = Join-Path $desktop $targetFileName | |
if(!(Test-Path $targetFile)) { | |
Write-Host "$targetFile が存在しませんでした" | |
exit | |
} | |
$contents = Get-Content $targetFile | |
# 先頭行削除 | |
$contents = $contents[1..($contents.Length)] | |
# ;を:に置換 | |
$contents = $contents | ForEach-Object {$_.replace(";",":")} | |
#先頭~空白~00:を削除 | |
$contents = $contents | ForEach-Object {$_ -replace "^\w*\s+?00:",""} | |
#:xx~空白を削除し半角スペースに置換 | |
$contents = $contents | ForEach-Object {$_ -replace ":\d\d\s+"," "} | |
#行末の空白を削除 | |
$contents = $contents | ForEach-Object {$_ -replace "\s+$"," "} | |
set-clipboard $contents |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment