OE PowerTool 4.5.5
Twój adres IP to: 18.97.9.168
Przeglądarka: CCBot/2.0 (https://commoncrawl.org/faq/)
iconv.exe -t utf-8 "source.txt" > "target.txt"
Chodzi o to, że jeśli istnieje plik target.txt, to żeby był tworzony plik target(1).txt itd. A jeśli istnieje np. target(5).txt a nie istnieje
target(4).txt to żeby i tak był tworzony target(6).txt. Skrypt w PowerShellu, który to zadanie realizuje, może wyglądać tak:
$filename = "target.txt"
if(Test-Path "target.txt") {
$number = ls | foreach { if($_.Name -match "target\((\d+)\)\.txt") {$matches[1]} } | sort -InputObject {[decimal]$_} | select -last 1
$number++
$filename = "`"target`(" + $number + "`).txt`""
}
$command = "iconv.exe -t utf-8 source.txt > " + $filename
Invoke-Expression $command