Solved Create a batch script to pull unique records

August 6, 2012 at 12:43:29
Specs: Windows
How can I create a batch script that will pull all unique records based on the marketing asset id field?
Thanks

Sample Data:
campaignid|marketingassetid|campaigntacticid
123abc|a123a|123450987
456abc|a123a|123456789
123fgh|a123b|123456799
222333|a123b|123556677
222444|a123c|123098755
Expected Output
campaignid|marketingassetid|campaigntacticid
123abc|a123a|123450987
123fgh|a123b|123456799
222444|a123c|123098755


See More: Create a batch script to pull unique records

Report •


#1
August 7, 2012 at 03:57:24
✔ Best Answer
:: ===== script starts here ===============
::
:: cmie.bat 2012-08-07 14:11:15.17
@echo off > newfile & setLocal enableDELAYedeXpansioN

for /f "tokens=* delims= " %%a in (myfile) do (
set S=%%a
set S=!S:~7,5!
find "!S!" < newfile > nul || >> newfile echo %%a
)
::====== script ends here =================


====================================
Life is too important to be taken seriously.

M2


Report •

#2
August 7, 2012 at 12:44:33
thank you for your help

Report •

Related Solutions


Ask Question