Skip to content

Instantly share code, notes, and snippets.

@ebibibi
Created October 25, 2021 02:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebibibi/7f1aa45dfc0ff0967889f72110e27548 to your computer and use it in GitHub Desktop.
Save ebibibi/7f1aa45dfc0ff0967889f72110e27548 to your computer and use it in GitHub Desktop.
Adobe Premiereのマーカーをエクスポートしたテキストファイルを元にYoutubeのインデックスを作成するPowerShellスクリプト
$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