0
バッチスクリプトに別のバッチスクリプトを実装する必要があります。私は文字列をスキャンして "strings.txt"というテキストファイルに出力するスクリプトを持っています。そして、別のバッチスクリプトで重複した行を削除したいのです。何とか他のバッチスクリプトを実装したいと思っています。ここに私が適用する必要があるスクリプトがあります。バッチでDirコマンドのサポートが必要
@echo off
setlocal disableDelayedExpansion
set "file=%~1"
set "line=%file%.line"
set "deduped=%file%.deduped"
::Define a variable containing a linefeed character
set LF=^
::The 2 blank lines above are critical, do not remove
>"%deduped%" (
for /f usebackq^ eol^=^%LF%%LF%^ delims^= %%A in ("%file%") do (
set "ln=%%A"
setlocal enableDelayedExpansion
>"%line%" (echo !ln:\=\\!)
>nul findstr /ilg:"%line%" "%deduped%" || (echo !ln!)
endlocal
)
)
>nul move /y "%deduped%" "%~n1_deduped%~x1"
2>nul del "%line%"
これはすべて私のテキストファイルに起こる必要がありますが、このすべてまたはその変形が私のスクリプトに表示されます。
をこれは何をしなければなりませんあなたの質問に書いた 'DIR'コマンドを使ってください。 – Squashman
[バッチを重複する行をテキストファイルから削除する]の可能な複製(http://stackoverflow.com/questions/11689689/batch-to-remove-duplicate-rows-from-text-file) – Squashman
別のバッチファイルを呼び出すバッチファイル内で 'CALL'を使用してください。 – soja