Forum Discussion
Shree2280
Jan 27, 2021Brass Contributor
extract http data
Hi expert, I am trying to extract http:// URL from given file but getting empty file in export here is the code $items = Get-ChildItem -LiteralPath "E:\Backup_Testinstance\" | Where-Obje...
Shree2280
Jan 27, 2021Brass Contributor
http://hdfcebank.com/jhgsfgdsf ;kkjhadsf;kjnsdf ;kkjhadsf;kjnsdf ;kkjhadsf;kjnsdf ;kkjhadsf;kjnsdf
http://hdfcebank.com/jhgsfgdsf ;kkjhadsf;kjnsdf ;kkjhadsf;kjnsdf ;kkjhadsf;kjnsdf ;kkjhadsf;kjnsdf ;kkjhadsf;kjnsdf
http://cart.com/jhgsfgdsf ;kkjhadsf;kjnsdf ;kkjhadsf;kjnsdf
http://hdfcebank.com/jhgsfgdsf kuhsdfkhdsf
http://hdfcebank.com/jhgsfgdsf uhsfdhkjlsfd
lksdfsdkndsf
;lnskfdkjnsdf
hblshdfkjhdfs
Shree2280
Jan 27, 2021Brass Contributor
- farismalaebJan 27, 2021Steel Contributor
I had created a file and add the sample you provide
and using this code, was able to get the result with only http://websitename without spaces
$items=(($x=Get-Content -Path C:\test.txt).split(";") | where {$_ -like "http://*"}) foreach ($item in $items){ ($item.split(" "))[0] }- Shree2280Jan 29, 2021Brass Contributor