0

I want to remove specific pieces of text from a file, though I can only seem to get the whole line of text for 83: href="https://website.com/thing.rar"><img, but when I use when I use find /V "83:" | find /V "href=" it takes the whole line out.

How could I only selectively choose the link out of the bunch? This is what I've been using so far:

findstr /i /n "https://website.*rar" C:\Users\New\output.txt >> C:\Users\New\output2.txt

then

findstr /i /n /v "83: href= ><img" C:\Users\New\output2.txt >> C:\Users\New\output3.txt
theboy
  • 353
  • 2
  • 10
  • Did you want to get only the url ? – Hackoo Nov 14 '19 at 20:40
  • 2
    `findstr` *always* outputs the whole line (or suppresses the whole line with `/v`). `cmd` has no native way for what you want to do. Eiter split the string with a `for /f` loop with proper delims and tokens or use (the help of) another language, which supports proper REGEX. – Stephan Nov 14 '19 at 20:40
  • Are you trying to parse HTML? https://stackoverflow.com/a/1732454/447901 Get a tool that can handle XML such as PowerShell or Python. – lit Nov 14 '19 at 21:08

0 Answers0