문제

I need to create batch file what finds string in the code and insert them into new file.

For example, I have a file:

...

<aaaa> AAA </aaaa>

<bbbb> BBB </bbbbb>

<RESULT="RIV/123456789:123456/12:1234567" XXXX="xxx" YYYY="yyy" ZZZZ="zzz">

<cccc> CCC </cccc>

<dddd> DDD </dddd>

...

and in the separate file (for example results.txt) I need to export only the Results:

...
RIV/123456789:123456/12:1234567
RIV/123456789:123456/12:1234567
RIV/123456789:123456/12:1234567
...

I tried to figure out many times but with no luck :-( , I would appreciate your help!

Thank you in advance, James

도움이 되었습니까?

해결책

you might try this:

@ECHO OFF &SETLOCAL
(FOR /f tokens^=2delims^=^"  %%a IN ('findstr /l "RIV/" file') DO (
    ECHO(%%a
))>newfile
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top