# Help with removing string from list

**URL:** <https://forums.powershell.org/t/help-with-removing-string-from-list/21184>\
**Category:** PowerShell Help\
**Created:** [December 18, 2022, 5:57pm UTC](https://forums.powershell.org/t/help-with-removing-string-from-list/21184 "2022-12-18T17:57:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![psinha4569](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/psinha4569/32/4164_2.png) [@psinha4569](https://forums.powershell.org/u/psinha4569)\
**Post date:** [December 18, 2022, 5:57pm UTC](https://forums.powershell.org/t/help-with-removing-string-from-list/21184/1 "2022-12-18T17:57:22Z")

</div>

I’m trying to extract a list of file paths from a log file. The problem I’m having is removing the first text in the line so I can have only the path that I need.

I can successfully do:

```auto
Get-Content -Path "C:\Temp\files.log" | Select-string -Pattern "Some Text"

```

And that returns:  
Some Text “C:\path1\settings.xml”  
Some Text “C:\path2\settings.xml”  
Some Text “C:\path3\settings.xml”

How do I remove the “Some Text” from the beginning of each line?

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [December 18, 2022, 6:53pm UTC](https://forums.powershell.org/t/help-with-removing-string-from-list/21184/2 "2022-12-18T18:53:36Z")

</div>

How about catching everything in between double quotes? 😉

```auto
Select-String -Path C:\Temp\files.log -Pattern '(?<=").+(?=")' |
    Select-Object -ExpandProperty Matches |
        Select-Object -Property Value

```

---

<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:16pm UTC](https://forums.powershell.org/t/help-with-removing-string-from-list/21184/3 "2024-05-16T20:16:09Z")

</div>

Closed on May 16, 2024, 8:16pm UTC


