HFM_E_AHSM_FinRpt_Coor,,,xABC,Native Directory
HFM_E_AHSM_FinRpt_Coor,,,xDEF,Native Directory
HFM_E_AHSM_FinRpt_Coor,,,xGHI,Native Directory
HFM_E_AHSM_FinRpt_Coor,Test
Test,xABC,Native Directory
Test,xDEF,Native Directory
Test,xGHI,Native Directory
HFM_E_AHSM_FinRpt_Coor,Test,xABC
HFM_E_AHSM_FinRpt_Coor,Test,xDEF
HFM_E_AHSM_FinRpt_Coor,Test,xGHI
Хотел бы получить те же данные из Groups.txt выполните vlookup для Reviewer.txt и поместите соответствующие данные в столбец 2 , затем введите значения x .Наконец удалить последний столбец .
@echo off
setlocal EnableDelayedExpansion
rem Load File1 as lookup table:
for /F "tokens=1,2 delims=," %%a in (Reviewer.txt) do (
set "filename=%%~a"
set "col1_2[!filename: =_!]=%%~b"
)
rem Process File2:
for /F "tokens=1* delims=," %%a in (Groups.txt) do (
set "filename=%%a"
for /F %%f in ("!filename: =_!") do if defined col1_2[%%f] (
echo !col1_2[%%f]!,%%b
) else (
echo NoMatchingFilename,%%b
)
)