
:
![]() |
Name ![]() |
Ed. | Price | Type | Cost | P | Modified | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Rarity | Color | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Creature (4) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | Champion of Dusk | $0.30 | Creature - Vampire Knight | 4 | 17-Aug-2025 16:22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | Murmuring Mystic | $0.29 | Creature - Human Wizard | 1 | 17-Aug-2025 16:22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | River Kelpie | $0.18 | Creature - Beast | 3 | 17-Aug-2025 16:22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | Solemn Simulacrum | $0.32 | Artifact Creature - Golem | 2 | 17-Aug-2025 16:22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Instant (4) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | Corrupted Conviction | $0.17 | Instant | 17-Aug-2025 16:22 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | Displace | $0.45 | Instant | 17-Aug-2025 16:22 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | Frantic Search | $0.37 | Instant | 17-Aug-2025 16:22 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | Supernatural Stamina | $0.16 | Instant | 17-Aug-2025 16:22 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sorcery (3) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | Read the Bones | $0.23 | Sorcery | 17-Aug-2025 16:22 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | Sign in Blood | $0.38 | Sorcery | 17-Aug-2025 16:22 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | Unearth | $0.47 | Sorcery | 17-Aug-2025 16:22 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Artifact (4) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | Everflowing Chalice | $0.39 | Artifact | 17-Aug-2025 16:22 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | Orzhov Signet | $0.45 | Artifact | 17-Aug-2025 16:22 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | Transmogrant's Crown | $0.24 | Artifact - Equipment | 17-Aug-2025 16:22 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Enchantment (2) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | Chronic Flooding | $0.13 | Enchantment - Aura | 17-Aug-2025 16:22 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | Hidden Stockpile | $0.16 | Enchantment | 17-Aug-2025 16:22 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Land (8) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | Dimir Aqueduct | $0.26 | Land | 17-Aug-2025 16:22 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | Jwar Isle Refuge | $0.23 | Land | 17-Aug-2025 16:22 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | Orzhov Basilica | $0.23 | Land | 17-Aug-2025 16:22 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | Rakdos Carnarium | $0.52 | Land | 17-Aug-2025 16:22 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | Sunken Hollow | $0.34 | Land - Island Swamp | 17-Aug-2025 16:22 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | Temple of Deceit | $0.23 | Land | 17-Aug-2025 16:22 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | Temple of Silence | $0.24 | Land | 17-Aug-2025 16:22 |
Sideboard - 0 cards, 0 distinct
:
No cards here. :(
|
Comments
# CSV format: current_folder_path;new_folder_path;file_name
param(
[string]$CsvPath = "file_operations.csv"
)
# Set console encoding to UTF-8 to handle Turkish characters
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
$OutputEncoding = [System.Text.Encoding]::UTF8
# Function to generate all possible Turkish character combinations
function Get-TurkishVariations {
param([string]$Text)
# Find all positions that have potential Turkish character variations
$turkishPositions = @()
for ($i = 0; $i -lt $Text.Length; $i++) {
$char = $Text[$i]
$hasMapping = $false
$alternativeChar = $null
# Check each character explicitly
switch ($char) {
'I' { $hasMapping = $true; $alternativeChar = 'İ' }
'i' { $hasMapping = $true; $alternativeChar = 'ı' }
'G' { $hasMapping = $true; $alternativeChar = 'Ğ' }
'U' { $hasMapping = $true; $alternativeChar = 'Ü' }
'O' { $hasMapping = $true; $alternativeChar = 'Ö' }
'S' { $hasMapping = $true; $alternativeChar = 'Ş' }
'C' { $hasMapping = $true; $alternativeChar = 'Ç' }
}
if ($hasMapping) {
$turkishPositions += @{
Position = $i
Character = $char
AlternativeChar = $alternativeChar
}
}
}
# If no potential Turkish characters, return original text
if ($turkishPositions.Count -eq 0) {
return @($Text)
}
$variations = @()
$variations += $Text # Original text (from CSV)
# Generate all possible combinations using bit manipulation
$maxCombinations = [math]::Pow(2, $turkishPositions.Count) - 1
for ($combo = 1; $combo -le $maxCombinations; $combo++) {
$chars = $Text.ToCharArray()
# Check each bit position to see if we should replace with Turkish character
for ($j = 0; $j -lt $turkishPositions.Count; $j++) {
$bitMask = [math]::Pow(2, $j)
if (($combo -band $bitMask) -ne 0) {
# This bit is set, so replace with Turkish character
$pos = $turkishPositions[$j]
$chars[$pos.Position] = $pos.AlternativeChar
}
}
$newVariation = -join $chars
$variations += $newVariation
}
return $variations
}
# Function to find actual file/folder with Turkish character variations
function Find-ActualPath {
param(
[string]$BasePath,
[string]$SearchName,
[bool]$IsDirectory = $false
)
# If the exact path exists, return it
$exactPath = Join-Path $BasePath $SearchName
if (Test-Path -LiteralPath $exactPath) {
return $SearchName
}
# Generate all possible Turkish character variations
$variations = Get-TurkishVariations -Text $SearchName
# Try each variation
foreach ($variation in $variations) {
if ($variation -eq $SearchName) { continue } # Already tried exact match
$testPath = Join-Path $BasePath $variation
if (Test-Path -LiteralPath $testPath) {
if ($IsDirectory) {
if (Test-Path -LiteralPath $testPath -PathType Container) {
return $variation
}
} else {
if (Test-Path -LiteralPath $testPath -PathType Leaf) {
return $variation
}
}
}
}
return $null
}
# Check if CSV file exists
if (-not (Test-Path $CsvPath)) {
Write-Error "CSV file not found: $CsvPath"
exit 1
}
# Read CSV file with UTF-8 encoding and semicolon delimiter
try {
$csvData = Import-Csv -Path $CsvPath -Delimiter ';' -Encoding UTF8
Write-Host "Successfully loaded CSV with $($csvData.Count) rows" -ForegroundColor Green
} catch {
Write-Error "Failed to read CSV file: $($_.Exception.Message)"
exit 1
}
# Counters for summary
$successCount = 0
$failureCount = 0
$processed = 0
# Process each row
foreach ($row in $csvData) {
$processed++
$csvCurrentFolderPath = $row.current_folder_path
$csvNewFolderPath = $row.new_folder_path
$csvFileName = $row.file_name
Write-Progress -Activity "Processing files" -Status "Processing $csvFileName ($processed of $($csvData.Count))" -PercentComplete (($processed / $csvData.Count) * 100)
# Find actual folder path (handling Turkish character variations in folder paths)
$actualCurrentFolderPath = $csvCurrentFolderPath
if (-not (Test-Path -LiteralPath $csvCurrentFolderPath)) {
# Try to find folder with Turkish character variations
$parentPath = Split-Path $csvCurrentFolderPath -Parent
$folderName = Split-Path $csvCurrentFolderPath -Leaf
if (Test-Path -LiteralPath $parentPath) {
$actualFolderName = Find-ActualPath -BasePath $parentPath -SearchName $folderName -IsDirectory $true
if ($actualFolderName) {
$actualCurrentFolderPath = Join-Path $parentPath $actualFolderName
}
}
}
# Check if we found the actual folder
if (-not (Test-Path -LiteralPath $actualCurrentFolderPath)) {
Write-Warning "Source folder not found: $csvCurrentFolderPath"
$failureCount++
continue
}
# Find actual file name (handling Turkish character variations)
$actualFileName = Find-ActualPath -BasePath $actualCurrentFolderPath -SearchName $csvFileName -IsDirectory $false
if ($null -eq $actualFileName) {
Write-Warning "Source file not found: $csvFileName in $actualCurrentFolderPath"
$failureCount++
continue
}
# Update destination path based on actual folder path found
$actualNewFolderPath = $csvNewFolderPath
if ($actualCurrentFolderPath -ne $csvCurrentFolderPath) {
# Replace the folder name in destination path with the actual one found
$csvFolderName = Split-Path $csvCurrentFolderPath -Leaf
$actualFolderName = Split-Path $actualCurrentFolderPath -Leaf
$actualNewFolderPath = $csvNewFolderPath -replace [regex]::Escape($csvFolderName), $actualFolderName
}
# Construct full file paths with actual names
$sourceFile = Join-Path $actualCurrentFolderPath $actualFileName
$destinationFile = Join-Path $actualNewFolderPath $actualFileName # Use actual names for destination
# Create destination directory if it doesn't exist
if (-not (Test-Path -LiteralPath $actualNewFolderPath)) {
try {
New-Item -Path $actualNewFolderPath -ItemType Directory -Force | Out-Null
} catch {
Write-Error "Failed to create directory $actualNewFolderPath : $($_.Exception.Message)"
$failureCount++
continue
}
}
# Copy the file using -LiteralPath for proper character handling
try {
Copy-Item -LiteralPath $sourceFile -Destination $destinationFile -Force
$successCount++
} catch {
Write-Error "Failed to copy $sourceFile to $destinationFile : $($_.Exception.Message)"
$failureCount++
}
}
# Final summary
Write-Host "`n=== SUMMARY ===" -ForegroundColor Cyan
Write-Host "Total processed: $processed" -ForegroundColor White
Write-Host "Successful: $successCount" -ForegroundColor Green
Write-Host "Failed: $failureCount" -ForegroundColor Red
Write-Host "File copy operations completed!" -ForegroundColor Cyan[/regex][/bool][/string][/string][/$pos.Position][/$j][/math][/math][/$i][/string][/System.Text.Encoding][/System.Text.Encoding][/Console][/string]
Debug: Will generate 7 combinations
Debug: Generated variation: '03.Alİ Basaran Kiml.pdf'
Debug: Generated variation: '03.Ali Başaran Kiml.pdf'
Debug: Generated variation: '03.Alİ Başaran Kiml.pdf'
Debug: Generated variation: '03.Ali Basaran Kİml.pdf'
Debug: Generated variation: '03.Alİ Basaran Kİml.pdf'
Debug: Generated variation: '03.Ali Başaran Kİml.pdf'
Debug: Generated variation: '03.Alİ Başaran Kİml.pdf'
Debug: Total unique variations: 2
Trying 2 variations for: 03.Ali Basaran Kiml.pdf
Variations: 03.Alİ Basaran Kİml.pdf, 03.Alİ Başaran Kİml.pdf