$EndDatetime = Get-Date
for ($i=1; $i -le 1000; $i++) {
$query_year = $EndDatetime.AddDays(-$i).Year;
$query_Cyear = ($EndDatetime.AddDays(-$i).Year-1911).ToString("000");
$query_month = $EndDatetime.AddDays(-$i).Month.ToString("00");
$query_day = $EndDatetime.AddDays(-$i).Day.ToString("00");
$query_date = "$query_year%2F$query_month%2F$query_day";
$outputfilename = "$query_year-$query_month-$query_day";
$url = "";
$path = "D:\test\$outputfilename.html";
$client = new-object System.Net.WebClient;
$client.DownloadFile( $url, $path );
}

$output = "";
#在收尋文字檔中需要的文字
$files=get-childitem .
foreach ($file in $files) {
$a = (Get-Content $file)[600 .. 600] | select-string -Pattern "\d{1,3}年\d{1,3}月\d{1,3}日" -AllMatches | % { $_.Matches } | % { $_.Value };
$b = (Get-Content $file)[883 .. 883] | select-string -Pattern "\d{2}.\d{2}" -AllMatches | % { $_.Matches } | % { $_.Value };
$output += "$a^$b`n";
}
echo $output > test.txt;

abort 發表在 痞客邦 PIXNET 留言(0) 人氣()