# Help to search and print line with greater than like 50%

**URL:** <https://forums.powershell.org/t/help-to-search-and-print-line-with-greater-than-like-50/19321>\
**Category:** PowerShell Help\
**Created:** [May 16, 2022, 1:53am UTC](https://forums.powershell.org/t/help-to-search-and-print-line-with-greater-than-like-50/19321 "2022-05-16T01:53:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sundeeps82](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/sundeeps82/32/2373_2.png) [@sundeeps82](https://forums.powershell.org/u/sundeeps82)\
**Post date:** [May 16, 2022, 1:53am UTC](https://forums.powershell.org/t/help-to-search-and-print-line-with-greater-than-like-50/19321/1 "2022-05-16T01:53:49Z")

</div>

Hi All,

I am new to powershell, please suggest.

i was using Select-String -Path | -pattern, but it only search the given value.

I am trying to search and print line if that line value is 50% and above.  
ex: Print WESTDEV have 82%,81% that line has to be printed and send email.

. Print EASTDEV  
/dev/sdb 984G 289G 695G 30% /var/lib/influxdb  
/dev/sdb 984G 286G 699G 29% /var/lib/influxdb  
. Print WESTDEV  
/dev/sde 984G 798G 187G 82% /var/lib/influxdb  
/dev/sdc 984G 793G 192G 81% /var/lib/influxdb  
. Print EASTPST  
/dev/sdd 984G 439G 545G 45% /var/lib/influxdb

---

<div class="post-metadata">

**Author:** ![matt-bloomfield](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@matt-bloomfield](https://forums.powershell.org/u/matt-bloomfield)\
**Post date:** [May 16, 2022, 7:39am UTC](https://forums.powershell.org/t/help-to-search-and-print-line-with-greater-than-like-50/19321/2 "2022-05-16T07:39:20Z")

</div>

Hi, welcome to the forum 👋

Firstly, when posting code, data, and errors in the forum, please can you use the preformatted text \</\> button. It really helps us with readability, and copying and pasting your code (we don’t have to faff about replacing curly quote marks to get things working).  
[How to format code on PowerShell.org](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/2X/b/bee50c628238f2c076c0504efb6b15f2fb11f002.gif)

To find the percentage value above 50, you will need to use a regular expression:

```auto
Select-String -Path .\data.txt -Pattern '[5-9][0-9]%|100%' | 
    Select-Object -ExpandProperty Line

```

To send an e-mail use [Send-MailMessage](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/send-mailmessage?view=powershell-7.2)

---

<div class="post-metadata">

**Author:** ![sundeeps82](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/sundeeps82/32/2373_2.png) [@sundeeps82](https://forums.powershell.org/u/sundeeps82)\
**Post date:** [May 17, 2022, 1:33pm UTC](https://forums.powershell.org/t/help-to-search-and-print-line-with-greater-than-like-50/19321/3 "2022-05-17T13:33:30Z")

</div>

Thank you matt ! it worked for me.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:17pm UTC](https://forums.powershell.org/t/help-to-search-and-print-line-with-greater-than-like-50/19321/4 "2024-05-16T20:17:58Z")

</div>


