Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Testing Values in CSV file

$
0
0

Hi,

I have a csv file as shown below. I need to create an output csv file which will have only those TESTIDs where the COUNT(UFMID) >100. I am using the following code and I am running into issues. Also there are some characters in the csv file which seems to be the issue. 

COUNT(UFMID)||''||PLAZAID                                                      
$Results = @()
foreach ($P in $POSFile -as [Int])
{
$PL = $P.COUNTUFMID;
$LN = $P.TESTID;

Import-Csv 'C:\TESTReport.csv' | Where-Object {[int]$_.COUNTUFMID -gt 100} | Export-Csv -Path C:\TESTFinal.csv –NoTypeInformation
}

C:\TESTReport.csv is below


COUNT(UFMID)||''||TESTID                                                      
-----------------------------------------------                                 
643100
597501
111700
163420
267350
1215211


Viewing all articles
Browse latest Browse all 15028

Trending Articles