Link to home
Start Free TrialLog in
Avatar of SAM IT
SAM IT

asked on

Filter Micorsoft Excel sheet using Powershell

I have an Excel sheet with dump of data it contains headers mentioned below. Using powershell I Need to filter the excel sheet mail the output to My email ID

SamAccountName      DN      AccountIsDisabled      PrimarySMTPAddress      msExchRecipientDisplayType      msExchRecipientTypeDetails      msExchHomeServerName      extensionAttribute9      extensionAttribute11      Manager

Auto Filter requirement

 Select ExtensionAttribute9 - Filter People
      Select MSExchRecipientDisplaytype - Filter -2147483642 & 1073741824
      Select DN - Filter Contains Disbaled
      Highlight the rows & Delete till 3675 records / lines
      Select DN - Filter Contains Test
      Highlight all rows & Delete - except first / last 4 user lines
      Select DN - Filter Contains Resource
      Highlight all rows & Delete
      Select DN - Filter contains Third party
      Highlight all rows & Delete
      Sort SamAccountname
      Filter Account Disabled - True
      Filter DN - Does not contain MET
      Highlight all rows & Delete
      Clear Filters on DN and Account Disbled

      Count all records -  

Thanks in advance
Avatar of Qlemo
Qlemo
Flag of Germany image

Do you want to see only the count of the remaining rows?
Can you explain "Highlight the rows & Delete till 3675 records / lines"?
Avatar of SAM IT
SAM IT

ASKER

yes correct I want to see the remaining rows after deleting 3675 lines
This is not the answer to my question. Please try to be precise - the end result is only the count, or the remaining rows with content? The latter requires to send an attachment or do some HTML table formatting, and is much more work than just counting.

Also, you are talking about an XLSX (Excel) or CSV (comma-separated text) file?
Avatar of SAM IT

ASKER

@QLEMO

File extension is CSV

While filtering the excel sheet
Once we filter the DN using Disbaled content we will get nearly 10k records out of 10 K first 3675 records needs to be deleted

Select DN - Filter Contains Disbaled
      Highlight the rows & Delete till 3675 records / lines
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SAM IT

ASKER

good support