我嘗試編寫一個批解析文件的批處理文件,以創建另一個包含其內容的文件。 但是在新版本中,我會忽略以-Dremote
模式開頭的每一行。逐行讀取文件並忽略它們中的一部分
這裏是我的文件
-nl
fr_yy
-clean
-vmargs
-Dgma.environnement=staging
-Duser.timezone=CET
-Dgma.communication=remote
-Dgma.security.disable=false
-Xms256M
-Xmx768M
-XX:PermSize=64m
-XX:MaxPermSize=128m
-Dlogback.configurationFile=file:eclipse/conf-log/logback-error.xml
-Dshut.monitor.active=true
-Dshut.monitor.home=\\mynas05\GMData\Projets\RefonteUtilisateurs\Contrats\shut
-Dshut.applicationRuntimeEnv.systemPropertyKey=gma.environnement-nl
-Dremote_server_MessageWar=http://xxx.xxx.yy
-Dremote_port_MessageWar=40110
-Dremote_server_SinistreWar=http://xxx.xxx.yy
-Dremote_port_SinistreWar=40110
-Dremote_server_FacturationTiersWar=http://xxx.xxx.yy
這裏是代碼
for /f "tokens=*" %%A in (%tempFile%) do (
set test=%%A
IF NOT "!test:~0,7!"=="-Dremote"(type %%i>>%iniFile%)
)
但一切都在ini文件複製...
如果你需要幫助,給我們所有的代碼,不只是一個部分,我們不知道什麼%% i定義爲,或者如果你已經推遲啓用擴展,等等......還,既提供答案做你說你想要的東西,但是你不想要的東西,所以請重申你想要的,並給出例子輸入和輸出文件。 – nephi12