Extract specific data from a text file


so if orignal file 4000 page text file 200 email addresses in on random pages, , wanted extract 200 email addresses. how can wps spit out email addresses text file?

i have used command select-string "@" .\groupmemo.txt, not return email addresses , there no other instances of "@" sign in text file.  what going wrong?

thanks

using regex pull

$file = get-content "location of file" (select-string -inputobject $file -pattern '\w+@\w+\.\w+' -allmatches).matches | select value


thanks azam when see answers please mark answer if helpful..vote helpful.



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Error: 0x80073701 when trying to add Print Services Role in Windows 2012 Standard

Disconnecting from a Windows Server 2012 R2 file sharing session on a Windows 7,8,10 machine

Windows 2016 RDS event 1306 Connection Broker Client failed to redirect the user... Error: NULL