Batch File for Xml modification

前端 未结 3 1668
醉话见心
醉话见心 2021-01-22 07:13

i have an xml file on which i have to do modification basing on some rules and i want to know can we do that in the batch script. suppose the following is the sample of xml file

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-22 07:57

        @echo off
    
        ::get the line before desired tag
        for /f "tokens=1 delims=:" %%L in ('findstr /n "" some.xml') do set /a line=%%L-1
    
        ::create empty file 
        break>"%temp%\empty"
    
        ::get first <%line%> lines of the file 
        fc "%temp%\empty" "some.xml" /lb  %line% /t |more +4 | findstr /B /E /V "*****" >temp.xml
    
        :: add additional content
        echo ^
         
     
    热议问题