Files
flora2roa/ALTE/check_cf_litere.ps1

13 lines
546 B
PowerShell

# Ce coduri fiscale NENUMERICE apar in XML-urile Fidelio (posibili parteneri straini)
param([string]$Dir = "D:\PROIECTE\FLORA\FLORA2ROA\EXEMPLE\hotel")
$map = @{}
Get-ChildItem -Path $Dir -Filter 'bts_detalii_facturi_rep_*.xml' | ForEach-Object {
$t = Get-Content $_.FullName -Raw
foreach ($m in [regex]::Matches($t, '(?i)<CODFISCAL_CNP>([^<]*)</CODFISCAL_CNP>')) {
$v = $m.Groups[1].Value.Trim()
if ($v -ne '' -and $v -match '[A-Za-z]') { $map[$v] = 1 }
}
}
"coduri cu litere = $($map.Count)"
$map.Keys | Sort-Object