We help IT Professionals succeed at work.

Filter Micorsoft Excel sheet using Powershell

689 Views
Last Modified: 2018-02-02
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
Comment
Watch Question

Qlemo"Batchelor", Developer and EE Topic Advisor
CERTIFIED EXPERT
Top Expert 2015

Commented:
Do you want to see only the count of the remaining rows?
Can you explain "Highlight the rows & Delete till 3675 records / lines"?
SAM ITAD windows Admin  

Author

Commented:
yes correct I want to see the remaining rows after deleting 3675 lines
Qlemo"Batchelor", Developer and EE Topic Advisor
CERTIFIED EXPERT
Top Expert 2015

Commented:
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?
SAM ITAD windows Admin  

Author

Commented:
@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
"Batchelor", Developer and EE Topic Advisor
CERTIFIED EXPERT
Top Expert 2015
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
SAM ITAD windows Admin  

Author

Commented:
good support

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.