I know its easy for you guys but I Need you Your Help. I have 2 CSV files
fileA.csv= All Files Paths on Server in column A
column A |
---|
/Volumes/../.../file1.mov |
/Volumes/../.../file2.jpg |
/Volumes/../.../file3.mp3 |
Exactly 200K records
FileB.csv= File Names for missing files I need to Located in Column A (File1.mov)
column A |
---|
/file2.jpg |
/file1.mov |
/file4.txt |
/file3.mp3 |
What i need is to Check the file name with extension in fileB.csv and match it with correct path in fileA.csv . If a File name from fileA.csv in FileB.csv is not located it should mention that its not found. so the output file looks like this
ColumnA | ColumnB. |
---|---|
File1.mov | /Volumes/../.../file1.mov) |
File2.jpg | /Volumes/../.../file2.jpg) |
File3.mp3 | N/A |
This What i made till now
$org = import-csv "fileA.csv"
$diff = import-csv "FileBcsv"
foreach($row in $org){
$diffRow = $diff | Get-Process | Where-Object {$_.rule -eq $row.Rule}
[pscustomobject]@{
Rule = $row.rule
Value = $row.value
Match = if($row.Value -eq $diffrow.Value){'Match'}else{"NoMatch:" +$row.Value+ $diffrow.Value}
}
}
$Results | Export-Csv -Path "./OutPutFile.csv" -NoTypeInformation
Its still processing so i still dont know the if its gonna work or not