Uma das coisas que gosto no Windows PowerShell "(C) Microsoft Corporation" é
a sua vasta documentação. Mesmo ignorando, quase que por completo, a sua
estrutura semantica e sintática é possível, através de outos exemplos, escrever
um script para leitura, ordenamento, classificação e escrita de arquivo txt.
O exemplo que se segue foi elaborado a partir de uma necessidade real:
Importação de dados utilizando o MILE. (obviamente que, dado o caráter
confidencial dos dados, veremos apenas um pequeno fragmento deles. A parte que
interessa: A chave).
O arquivo a ser processado possui 6 “canais” 0 a 5 e possui dados duplicados,
está desordenado e possui informações para mais de uma filial (O MILE se limita
a importar dados apenas para a Filial corrente).
Um fragmento do arquivo:
0101;000001;SRA_0;...;
0101;000002;SRA_0;...;
0101;000003;SRA_0;...;
0101;000004;SRA_0;...;
0101;000005;SRA_0;...;
0101;000006;SRA_0;...;
…
0105;015744;SRA_0;...;
0105;015744;SRA_1;...;
0105;015744;SRA_2;...;
0105;015744;SRA_4;...;
0105;015744;SRA_5;...;
0105;016231;SRA_0;...;
0105;016231;SRA_1;...;
0105;016231;SRA_2;...;
0105;016231;SRA_4;...;
0105;016231;SRA_5;...;
A ideia será ler o arquivo, ordena-lo e gerar tantos arquivos, quantos
necessários, para atender as seguintes regras:
1) Arquivo ordenado por “Filial,Matricula e Canal;
2) Dados de apenas uma “Filial” por arquivo e;
3) Arquivos classificados por “CANAL”.
Ao “script”
#file:sra-split.ps1
#Author:Marinaldo de Jesus
#date:2015-01-06
#Use:1) Ordenar o arquivo de saída do sistema Senior
# 2) Dividir o arquivo gerando os dados por Filial
# 3) Separar em Canais Válidos
#Define o Nome do Arquivo Gerado pelo Senior
Function sra-split
{
[CmdletBinding(
SupportsShouldProcess=$True,
ConfirmImpact="Low"
)
]
Param(
[Parameter(Mandatory=$True,Position=1)]
[string]$filePath="sra.txt"
)
$txtSRA=$filePath
$fName=[System.IO.Path]::GetFileNameWithoutExtension($txtSRA)
$txtSort=$txtSRA.Replace($fName,"$($fName)-sort")
#Obtém o Conteúdo do Arquivo
$sortSRA=Get-Content $txtSRA
#Ordena as Informações
$sortSRA | sort-object | Out-File -FilePath $txtSort -Encoding ascii -Force
#Define o Path para a Gravação dos Arquivos
$pathSRA=".\split\sra\"
#Obtém o Conteúdo do Arquivo Ordenado
$sortSRA=Get-Content $txtSort
#Força a Criação do Diretório Split a partir de .\
New-Item -path $pathSRA -type directory -Force
#Remove qualquer item existente em .\split
Remove-Item -Path "$pathSRA\*"
#Define a HashTable com os Canais
$Canais=@{
SRA_0="SRA_0";
SRA_1="SRA_1";
SRA_2="SRA_2";
SRA_3="SRA_3";
SRA_4="SRA_4";
SRA_5="SRA_5"
}
#Define o Array com as Filiais
$Filiais=@("0101","0102","0103","0104","0105")
#Define bgColor
$bgColor="Black"
#Define fgColor
$fgColor="DarkRed"
#Define variável para controle de alteração da cor
$bChgColor=$True
#Define separador
$cSep="--------------------------------------------------------------------------"
$FilePath=""
Write-Host $cSep -foregroundcolor yellow -backgroundcolor $bgColor
#Lê o conteúdo do arquivo e gera um novo arquivo por Filial
foreach ($Filial in $Filiais) {
$key=""
$lKey=""
#Processa para cada CANAL
foreach ($Canal in $Canais.Values | Sort-Object )
{
Write-Host $Filial,$Canal
Write-Host $cSep -foregroundcolor yellow -backgroundcolor $bgColor
#Gera o arquivo por Filial e Canal
$sortSRA | ? {$_.Substring(0,4).Contains($Filial) -and $_.Substring(12,5).Contains($Canal) } | ? {
#Obtém a chave para pesquisa
$key=$_.Substring(0,17)
#Verifica se é igual a última chave utilizada
if ($key -eq $lKey){
#Define o arquivo para dados duplicados
$FilePath="$($pathSRA)dupl-sra-$($Filial)-$($Canal).txt"
} else {
#Define o arquivo para dados OK
$FilePath="$($pathSRA)sra-$($Filial)-$($Canal).txt"
}
#Grava os Dados no novo arquivo
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
#Salva a última chave utilizada
$lKey=$key
}
}
#Obtem o conteúdo para o CANAL sra_0
$FilePath="$($pathSRA)sra-$($Filial)-$($Canais['SRA_0']).txt"
[System.Collections.ArrayList]$t_sra_0=Get-Content $FilePath | Where-Object {$_.Substring(12,5).Contains($Canais["SRA_0"])}
Remove-Item $FilePath -Force
#Obtem o conteúdo para o CANAL sra_1
$FilePath="$($pathSRA)sra-$($Filial)-$($Canais['SRA_1']).txt"
[System.Collections.ArrayList]$t_sra_1=Get-Content $FilePath | Where-Object {$_.Substring(12,5).Contains($Canais["SRA_1"])}
Remove-Item $FilePath -Force
#Obtem o conteúdo para o CANAL sra_2
$FilePath="$($pathSRA)sra-$($Filial)-$($Canais['SRA_2']).txt"
[System.Collections.ArrayList]$t_sra_2=Get-Content $FilePath | Where-Object {$_.Substring(12,5).Contains($Canais["SRA_2"])}
Remove-Item $FilePath -Force
#Obtem o conteúdo para o CANAL sra_3
$FilePath="$($pathSRA)sra-$($Filial)-$($Canais['SRA_3']).txt"
[System.Collections.ArrayList]$t_sra_3=Get-Content $FilePath | Where-Object {$_.Substring(12,5).Contains($Canais["SRA_3"])}
Remove-Item $FilePath -Force
#Obtem o conteúdo para o CANAL sra_4
$FilePath="$($pathSRA)sra-$($Filial)-$($Canais['SRA_4']).txt"
[System.Collections.ArrayList]$t_sra_4=Get-Content $FilePath | Where-Object {$_.Substring(12,5).Contains($Canais["SRA_4"])}
Remove-Item $FilePath -Force
#Obtem o conteúdo para o CANAL sra_5
$FilePath="$($pathSRA)sra-$($Filial)-$($Canais['SRA_5']).txt"
[System.Collections.ArrayList]$t_sra_5=Get-Content $FilePath | Where-Object {$_.Substring(12,5).Contains($Canais["SRA_5"])}
Remove-Item $FilePath -Force
#Processa a partir do CANAL sra_0
($t_sra_0) | Foreach-Object {$index=0 }{
Try
{
$key=$t_sra_0.Item($index).Substring(4,8)
if ($sra_1=$t_sra_1 | Where-Object {$_.Substring(4,8).Contains($key)})
{
if ($sra_2=$t_sra_2 | Where-Object {$_.Substring(4,8).Contains($key)})
{
if ($sra_3=$t_sra_3 | Where-Object {$_.Substring(4,8).Contains($key)})
{
if ($sra_4=$t_sra_4 | Where-Object {$_.Substring(4,8).Contains($key)})
{
if ($sra_5=$t_sra_5 | Where-Object {$_.Substring(4,8).Contains($key)})
{
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_1 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_2 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_3 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_4 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_5 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-1-2-3-4-5.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_1 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_2 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_3 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_4 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_5 -FilePath $FilePath -Encoding ascii -Append
$t_sra_1.Remove($sra_1)
$t_sra_2.Remove($sra_2)
$t_sra_3.Remove($sra_3)
$t_sra_4.Remove($sra_4)
$t_sra_5.Remove($sra_5)
}
else {
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_1 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_2 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_3 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_4 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-1-2-3-4.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_1 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_2 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_3 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_4 -FilePath $FilePath -Encoding ascii -Append
$t_sra_1.Remove($sra_1)
$t_sra_2.Remove($sra_2)
$t_sra_3.Remove($sra_3)
$t_sra_4.Remove($sra_4)
}
}
elseif ($sra_5=$t_sra_5 | Where-Object {$_.Substring(4,8).Contains($key)})
{
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_1 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_2 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_3 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_5 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-1-2-3-5.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_1 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_2 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_3 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_5 -FilePath $FilePath -Encoding ascii -Append
$t_sra_1.Remove($sra_1)
$t_sra_2.Remove($sra_2)
$t_sra_3.Remove($sra_3)
$t_sra_5.Remove($sra_5)
}
else {
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_1 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_2 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_3 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-1-2-3.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_1 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_2 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_3 -FilePath $FilePath -Encoding ascii -Append
$t_sra_1.Remove($sra_1)
$t_sra_2.Remove($sra_2)
$t_sra_3.Remove($sra_3)
}
}
elseif ($sra_4=$t_sra_4 | Where-Object {$_.Substring(4,8).Contains($key)})
{
if ($sra_5=$t_sra_5 | Where-Object {$_.Substring(4,8).Contains($key)})
{
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_1 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_2 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_4 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_5 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-1-2-4-5.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_1 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_2 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_4 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_5 -FilePath $FilePath -Encoding ascii -Append
$t_sra_1.Remove($sra_1)
$t_sra_2.Remove($sra_2)
$t_sra_4.Remove($sra_4)
$t_sra_5.Remove($sra_5)
}
}
elseif ($sra_5=$t_sra_5 | Where-Object {$_.Substring(4,8).Contains($key)})
{
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_1 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_2 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_5 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-1-2-5.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_1 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_2 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_5 -FilePath $FilePath -Encoding ascii -Append
$t_sra_1.Remove($sra_1)
$t_sra_2.Remove($sra_2)
$t_sra_5.Remove($sra_5)
}
else {
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_1 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_2 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-1-2.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_1 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_2 -FilePath $FilePath -Encoding ascii -Append
$t_sra_1.Remove($sra_1)
$t_sra_2.Remove($sra_2)
}
}
else {
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_1 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-1.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_1 -FilePath $FilePath -Encoding ascii -Append
$t_sra_1.Remove($sra_1)
}
}
elseif ($sra_2=$t_sra_2 | Where-Object {$_.Substring(4,8).Contains($key)})
{
if ($sra_3=$t_sra_3 | Where-Object {$_.Substring(4,8).Contains($key)})
{
if ($sra_4=$t_sra_4 | Where-Object {$_.Substring(4,8).Contains($key)})
{
if ($sra_5=$t_sra_5 | Where-Object {$_.Substring(4,8).Contains($key)})
{
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_2 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_3 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_4 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_5 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-2-3-4-5.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_2 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_3 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_4 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_5 -FilePath $FilePath -Encoding ascii -Append
$t_sra_2.Remove($sra_2)
$t_sra_3.Remove($sra_3)
$t_sra_4.Remove($sra_4)
$t_sra_5.Remove($sra_5)
}
else {
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_2 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_3 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_4 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-2-3-4.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_2 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_3 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_4 -FilePath $FilePath -Encoding ascii -Append
$t_sra_2.Remove($sra_2)
$t_sra_3.Remove($sra_3)
$t_sra_4.Remove($sra_4)
}
}
elseif ($sra_4=$t_sra_4 | Where-Object {$_.Substring(4,8).Contains($key)})
{
if ($sra_5=$t_sra_5 | Where-Object {$_.Substring(4,8).Contains($key)})
{
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_2 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_4 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_5 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-2-4-5.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_2 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_4 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_5 -FilePath $FilePath -Encoding ascii -Append
$t_sra_2.Remove($sra_2)
$t_sra_4.Remove($sra_4)
$t_sra_5.Remove($sra_5)
}
}
elseif ($sra_5=$t_sra_5 | Where-Object {$_.Substring(4,8).Contains($key)})
{
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_2 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_5 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-2-5.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_2 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_5 -FilePath $FilePath -Encoding ascii -Append
$t_sra_2.Remove($sra_2)
$t_sra_5.Remove($sra_5)
}
else {
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_2 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_3 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-2-3.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_2 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_3 -FilePath $FilePath -Encoding ascii -Append
$t_sra_2.Remove($sra_2)
$t_sra_3.Remove($sra_3)
}
}
elseif ($sra_4=$t_sra_4 | Where-Object {$_.Substring(4,8).Contains($key)})
{
if ($sra_5=$t_sra_5 | Where-Object {$_.Substring(4,8).Contains($key)})
{
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_2 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_4 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_5 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-2-4-5.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_2 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_4 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_5 -FilePath $FilePath -Encoding ascii -Append
$t_sra_2.Remove($sra_2)
$t_sra_4.Remove($sra_4)
$t_sra_5.Remove($sra_5)
}
}
elseif ($sra_5=$t_sra_5 | Where-Object {$_.Substring(4,8).Contains($key)})
{
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_2 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_5 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-2-5.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_2 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_5 -FilePath $FilePath -Encoding ascii -Append
$t_sra_2.Remove($sra_2)
$t_sra_5.Remove($sra_5)
}
else {
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_2 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-2.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_2 -FilePath $FilePath -Encoding ascii -Append
$t_sra_2.Remove($sra_2)
}
}
elseif ($sra_3=$t_sra_3 | Where-Object {$_.Substring(4,8).Contains($key)})
{
if ($sra_4=$t_sra_4 | Where-Object {$_.Substring(4,8).Contains($key)})
{
if ($sra_5=$t_sra_5 | Where-Object {$_.Substring(4,8).Contains($key)})
{
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_3 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_4 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_5 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-3-4-5.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_3 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_4 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_5 -FilePath $FilePath -Encoding ascii -Append
$t_sra_3.Remove($sra_3)
$t_sra_4.Remove($sra_4)
$t_sra_5.Remove($sra_5)
}
else {
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_3 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_4 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-3-4.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_3 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_4 -FilePath $FilePath -Encoding ascii -Append
$t_sra_3.Remove($sra_3)
$t_sra_4.Remove($sra_4)
}
}
elseif ($sra_5=$t_sra_5 | Where-Object {$_.Substring(4,8).Contains($key)})
{
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_3 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_5 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-3-5.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_3 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_5 -FilePath $FilePath -Encoding ascii -Append
$t_sra_3.Remove($sra_3)
$t_sra_5.Remove($sra_5)
}
else {
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_3 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-3.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_3 -FilePath $FilePath -Encoding ascii -Append
$t_sra_3.Remove($sra_3)
}
}
elseif ($sra_4=$t_sra_4 | Where-Object {$_.Substring(4,8).Contains($key)})
{
if ($sra_5=$t_sra_5 | Where-Object {$_.Substring(4,8).Contains($key)})
{
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_4 -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_5 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-4-5.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_4 -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_5 -FilePath $FilePath -Encoding ascii -Append
$t_sra_4.Remove($sra_4)
$t_sra_5.Remove($sra_5)
}
else {
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_4 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-4.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_4 -FilePath $FilePath -Encoding ascii -Append
$t_sra_4.Remove($sra_4)
}
}
elseif ($sra_5=$t_sra_5 | Where-Object {$_.Substring(4,8).Contains($key)})
{
Write-Host $_ -foregroundcolor $fgColor -backgroundcolor $bgColor
Write-Host $sra_5 -foregroundcolor $fgColor -backgroundcolor $bgColor
$FilePath="$($pathSRA)sra-$($Filial)-Channels-0-5.txt"
Out-File -inputobject $_ -FilePath $FilePath -Encoding ascii -Append
Out-File -inputobject $sra_5 -FilePath $FilePath -Encoding ascii -Append
$t_sra_5.Remove($sra_5)
}
}
Catch
{
Write-Host $_.Exception.Message -foregroundcolor red -backgroundcolor yellow
}
Finally
{
}
$index++
if ($bChgColor) {
$fgColor="White"
}
else {
$fgColor="DarkRed"
}
$bChgColor= -not($bChgColor)
Write-Host $cSep -foregroundcolor yellow -backgroundcolor $bgColor
}
}
}
sra-split "sra.txt"
[]s
иαldσ dj
With mechanical machines, there was a chance for successful symbols to pop up extra frequently, however now with computerised models, the chances are extra complex and there are numerous types of slots by variance. Debuting with Thunder Drums™ – Leaping Lions™ and Mayan Mask™, this collection spotlights the Triple Pot mechanic. Watch out for gold lightning symbols, which award credit score prizes. Trigger the Thunder Prize and you’ll be awarded the sum of values displayed on 토토사이트 gold lighting symbols and 3-30 credit score prizes up to as} a 50x guess multiplier. The thunder keeps rolling with the free video games bonus and jackpot characteristic, giving you the possibility to win one of four progressives and two bonuses. This number signifies how frequently the machines pay out, and the higher the percentage the extra likely your probabilities of successful.
ResponderExcluir