|Can somebody help me to finish this script?|
0 down vote favorite
I have file like this: http://www.crocko.com/9A60004ABE604... (Please click on the right bottom. There is timer but I did not find upload server without timer. In the file are tabulators, thats why I uploaded it on server)
and this is script to read it:
if "%1"=="" (
IF EXIST "..\_install\activate all regions.txt" (
SET FILE="..\_INSTALL\activate all regions.txt"
echo Setting !FILE! as your configuration file
) ELSE (
echo File not found. First argument is name of configuration file .txt.
) else ( SET "FILE=%1")
for /F "skip=4 delims=pR tokens=1,2" %%a in ( 'reg query hkcu\environment /v temp' ) do set TAB=%%b
FOR /F "usebackq delims=!TAB! tokens=1-3" %%L IN (!FILE!) DO (
for /F "delims=!TAB! tokens=1-3" %%a in ("%%L") do echo A:"%%a"B:"%%b"C:"%%c"
REM echo %%L
I want to get output like:
A:"Directory name 1"B:"1"C:"Description to this line"
A:"Directory name 2"B:"1"C:"Description to this line"
A:"Directory name xxx"B:"1"C:"Description to this line"
The goal is to filter the tabs that are repeated (tab)(tab)(tab)(tab) and replace to one (tab). So the first step needs to result in columnA(tab)columnB(tab)columnC(tab) and then in the second step to parse it to get the columns into three variables.