Extracting specific lines (based on the line number) using batch file - windows

I have a need to extract specific lines from a text file (input.txt). I have already found a solution but have some clarifications why it is not working when used with setlocalenabledealyed expansion. Below is the example
My input.txt (numbered using findstr /n). In this example, I need to extract the lines between line number 27 to 39. In my full batch file, these values are called from another module.
1:[root]
2:ASKEHPPTEQWEIRAZOKXL
...
...
...
27:[parent2/child2]
28:NJ35CG5D9DEYXKMQKBJX
29:ZAZRMGB2E0KAG85FSPI3
30:E9046AQL44LV1R79OT8E
31:8OPXV1QYCTQVK34JZ2KV
32:3E32PWHGX5RGTFUXI9GC
33:H7DTDDFQZVGETGL764YU
34:174UOQMW35BCIQJNR1P8
35:7B3V0E9QXFQOM3NF08CZ
36:QH6FZVMKKGHKF0J8PB5O
37:QCRC90QCWWGAHRWBVMUI
38:4QPVEJW75GFW8DUM1PGU
39:[parent2/child3]
...
...
...
3000:[end]
1st code - calling.bat - using CALL
#echo OFF
set st_ln=27
set end_ln=39
for /f "tokens=1,2 delims=:" %%a in (input.txt) do call :extract "%%a" "%%b"
goto :eof
:extract
set "ln=%~1"
set "sid=%~2"
if %ln% LEQ %st_ln% goto :eof
if %ln% GEQ %end_ln% goto :eof
echo.%sid%
goto :eof
:eof
2nd code - local.bat used with setlocalenabledelayedexpansion
REM #echo OFF
set st_ln=27
set end_ln=39
SETLOCAL ENABLEDELAYEDEXPANSION
for /f "tokens=1,2 delims=:" %%a in (input.txt) do (
set "ln=%%a"
set "sid=%%b"
if !ln! LEQ !st_ln! goto :eof
if !ln! GEQ !end_ln! goto :eof
echo.!sid!
)
:eof
OUTPUT - Calling.bat works absolutely fine. But local.bat does not return any error, but it iterates the for loop only once. (I tried replacing !st_ln! & !end_ln! with %st_ln% & %end_ln%, but still the same issue) Why? What am I missing?
C:\Temp>calling.bat
NJ35CG5D9DEYXKMQKBJX
ZAZRMGB2E0KAG85FSPI3
E9046AQL44LV1R79OT8E
8OPXV1QYCTQVK34JZ2KV
3E32PWHGX5RGTFUXI9GC
H7DTDDFQZVGETGL764YU
174UOQMW35BCIQJNR1P8
7B3V0E9QXFQOM3NF08CZ
QH6FZVMKKGHKF0J8PB5O
QCRC90QCWWGAHRWBVMUI
4QPVEJW75GFW8DUM1PGU
C:\Temp>local.bat
C:\Temp>REM #echo OFF
C:\Temp>set st_ln=27
C:\Temp>set end_ln=39
C:\Temp>SETLOCAL ENABLEDELAYEDEXPANSION
C:\Temp>for /F "tokens=1,2 delims=:" %a in (input.txt) do (
set "ln=%a"
set "sid=%b"
if !ln! LEQ !st_ln! goto :eof
if !ln! GEQ !end_ln! goto :eof
echo.!sid!
)
C:\Temp>(
set "ln=1"
set "sid=[root]"
if !ln! LEQ !st_ln! goto :eof
if !ln! GEQ !end_ln! goto :eof
echo.!sid!
)
C:\Temp>
Supplementary Question :
As I said above, I could get the expected result, but just want to know if it can be enhanced. I want to extract specific lines (lines could be anywhere in input file and number of line I need could be 1 to 20), from the input file which could have up to 3000 lines. Currently in the above code I am using the for loop and checking the line number for each line and so it will iterate through the for loop for 3000 times, which could potentially delay the output. Is there any other way to avoid this and to speed up the script (may be findstr 'range' search)?

Your local.bat does not work because when the first line is readed, with number 1, and starting line 27, the condition if !ln! LEQ !st_ln! goto :eof is evaluated as true and the goto command executed, leaving the for loop.
For the supplementary question, you can calculate how many rows need to be skipped at the start of the file and then only process until the end line is reached. As no variable is changed inside the loop, there is no need for delayed expansion
set /a "skipLines=st_ln-1"
if %skipLines% gtr 0 (
set "skipLines=skip=%skipLines%"
) else (
set "skipLines="
)
for /f "%skipLines% tokens=1,2 delims=:" %%a in (input.txt
) do if %%a gtr %end_ln% ( goto :eof ) else (
echo(%%b
)
The if %skiplines% gtr 0 test is necessary as the for /f loop does not allow a skip=0 clause

Related

cmd: How to include a maximum run time in the for loop?

I have a long list and i want to split it up in parts that will wait for an external trigger to go on.
At first I tried a for loop that did 100 rows per run.
But because of differences in workload on the pc the amount of time it takes varies.
So i was wondering, is it possible to loop the FOR statement for a set time.
But could not find any example.
After adding the suggestion stephan made to use a for loop with delayed expansion, it now works.
How to include a maximum run time in the for loop?
'''
#ECHO OFF
SETLOCAL enabledelayedexpansion
CLS
set ENDTIME=!TIME!
set function_endtime=!ENDTIME!
for /F "tokens=1-4 delims=:.," %%a in ("%function_endtime%") do (
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
:: add 4 seconds to current time as end time
set /A function_endtime=start+(4*100)
:: Format the result for use in if loop
set /A hh=function_endtime/(60*60*100),rest=function_endtime%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
if %hh% lss 10 set hh=0%hh%
if %mm% lss 10 set mm=0%mm%
if %ss% lss 10 set ss=0%ss%
if %cc% lss 10 set cc=0%cc%
set function_endtime=%hh%:%mm%:%ss%.%cc%
echo Finish: %function_endtime% now: %time%
FOR /F "tokens=1,2 delims=," %%A IN (C:\test.txt) DO (
echo %%A %%B
set "last_value=%%B"
if "!time!" geq "%function_endtime%" goto :done
)
:done
echo %time%
'''
you can't put code between goto and the :label I guess you completely misinterpreted my comment. Your code should look like:
...
FOR /F "tokens=1,2 delims=," %%A IN (C:\test.txt) DO (
echo %%A %%B
set "last_value=%%B"
if "!time!" geq "%function_endtime%" goto :done
)
:done
...
(without any testing or checking your logic)

Batch code to turn every line of text to a variable

So I need a code that will take a text file (we'll cal it list.txt) and turn every line into a variable.
To give some context, I have some file names listed in list.txt, which adds and deletes file names occasionally by user request. I want the user of this code to be able to select which document they'd like to open using variables.
For example, if list.txt looks like this
list.txt
loading.txt
test1.txt
test2.txt
test3.txt
test4.txt
Then I'd like an automatic variable for every .txt listed. I then would add a simple if statement to open the file matched with the variable.
Am I making this too complicated for myself or is this the only way to do this?
EDIT:
I am not attempting something like this:
type list.txt
echo.
echo.
set /p GROUPSELECT= Please type out the FULL name of the group listed:
CD %grouplist%
type %GROUPSELECT%
It will display the file contents, and then display the specific file chosen by the input. I'd think that the variable might be easier to do more with later though, just a thought.
Edit2
I tried this:
#Echo OFF
FOR /F "Usebackq Delims=" %%a IN (
"list.txt"
) DO (
set jim=%%a
)
echo %jim%
PAUSE
%jim% will only be the last line in the text file, so how do I make the next step into making them all different?
Give this a try. I have commented each line of code that should explain what it is doing. Let me know if you need any further explanation.
#echo off
REM FOR commnd is parsing the output of the FINDSTR commands.
REM First FINDSTR command is finding non empty lines in the file
REM Second Findstr command is assigning a number to each line of the file
REM The output is split into two tokens and the number is assigned to %%G and the line of the file to %%H
for /F "tokens=1* delims=:" %%G IN ('findstr /V "^$" list.txt ^|findstr /N ".*"') DO (
REM create a variable of the lines in the file
set "file%%G=%%H"
REM Create a menu of the lines in the file
echo %%G %%H
REM Get the number of lines in the output
set "num=%%G"
)
REM Ask user to chose a number
set /P "filenum=Chose a file number 1 to %num%:"
REM Need to enable delayed expansion to use array variables
setlocal enabledelayedexpansion
REM Check if they type in a correct number and display the file
IF DEFINED file%filenum% type !file%filenum%!
endlocal
pause
Is this the sort of thing you're looking for?
#For /F "Delims==" %%# In ('Set # 2^>Nul')Do #Set "%%#="
#For /F Tokens^=1*Delims^=[]^ EOL^= %%# In ('Type "file.txt"^|Find /V /N ""'
)Do #Set "#%%#=%%$"&Echo( %%#. %%$
:Opt
#Echo(
#Set /P "Opt=Choose a document to open>"
#Set #|Findstr /B "#%Opt%=">Nul||GoTo :Opt
#Call Start "" "%%#%Opt%%%"
Just change the name of the text file containing your list on line 2 as needed.
#TheBoy your question is confusingly framed. If you DO NOT want the example you put in the edit, then can you better explain what you DO want??
Do you want to say iterate over the list file, and create a choice screen?
#(SETLOCAL EnableDelayedExpansion
ECHO OFF
SET "_ChoiceList_File=C:\Admin\ChoiceFile.txt"
REM Full Character List to populate Choices
SET "_CharList=0 1 2 3 4 5 6 7 8 9 A B C D E F N X"
)
CALL :Main
( ENDLOCAL
EXIT /B 0
)
:Main
REM Now we can Do Our Choices btu lets do it in a Sub Function.
CALL :MakeChoice _ChoiceResult
ECHO.
ECHO The Index Chosen Was: %_Chosen%
ECHO The Result Matched is: "%_ChoiceResult%"
REM ECHO Here you output "%_ChoiceResult%"
TYPE "%_ChoiceResult%"
GOTO :EOF
:MakeChoice
cls
color 1A
SET %~1="
SET "_Choices="
SET "_Chosen="
SET "_Amount="
SET "_Choice.17.Value=Next Set!"
SET "_Choice.18.Value=EXIT!"
SET "_Choice_Show_Next="
echo. Pick a File:
echo.========================
REM Create Numbered Array of Choices and output Choices to the Screen
FOR /F "tokens=* usebackq" %%A IN ("%_ChoiceList_File%") DO (
SET /A "_Amount+=1"
SET "_Choice.!_Amount!.Value=%%A"
IF !_Amount! EQU 16 (
SET /A "_Amount+=2"
CALL :MakeChoice "%~1"
IF DEFINED _Chosen (
IF !_Chosen! NEQ 17 (
REM IF !_Chosen! NEQ 18 (
GOTO :EOF
REM )
)
SET "_Amount="
SET "_Chosen="
)
)
)
IF NOT DEFINED _Chosen (
SET /A "_Amount+=1"
SET "_Choice.!_Amount!.Value=!"
SET /A "_Amount+=1"
SET "_Choice.!_Amount!.Value=EXIT!"
CALL :MakeChoice "%~1"
)
GOTO :EOF
:MakeChoice
CLS
ECHO.
SET "_Temp="
SET "_Choices="
SET /A "_Skipline= !_Amount! - 1"
REM Create Choice List to Display only the choices needed.
FOR %%A IN (%_CharList%) DO (
SET /A "_Temp+=1"
IF !_Temp! LEQ !_Amount! (
IF !_Temp! EQU !_Skipline! (
ECHO.
ECHO.=============================
)
IF DEFINED _Choice.!_Temp!.Value (
SET "_Choices=!_Choices!%%A"
CALL ECHO. %%A : %%_Choice.!_Temp!.Value%%
)
)
)
ECHO.
CHOICE /C !_Choices! /N /M "What File do you want to choose? "
SET "_Chosen=%ERRORLEVEL%"
SET "%~1=!_Choice.%_Chosen%.Value!"
GOTO :EOF
)
You can try this:
#echo off
setlocal enabledelayedexpansion
set jim=
for /f "delims=] tokens=1*" %%a in ('find /v /n "" ^<list.txt') do (
set jim=!jim! %%b
)
echo Select a file from !jim!
set /p file=
type !file!
pause
This will read all lines from the list.txt and return them within a variable !jim!.

sorting files according to keywords, need a more database-y solution

I'm making a script that sorts video files into folders by checking for known keywords in the file. As the amount of keywords grows out of control the script becomes very slow, taking several seconds for each file to be processed.
#echo off
cd /d d:\videos\shorts
if /i not "%cd%"=="d:\videos\shorts" echo invalid shorts dir. && exit /b
:: auto detect folder name via anchor file
for /r %%i in (*spirit*science*chakras*) do set conspiracies=%%~dpi
if not exist "%conspiracies%" echo conscpiracies dir missing. && pause && exit /b
for /r %%i in (*modeselektor*evil*) do set musicvideos=%%~dpi
if not exist "%musicvideos%" echo musicvideos dir missing. && pause && exit /b
for %%s in (*) do set "file=%%~nxs" & set "full=%%s" & call :count
for %%v in (*) do echo can't sort "%%~nv"
exit /b
:count
set oldfile="%file%"
set newfile=%oldfile:&=and%
if not %oldfile%==%newfile% ren "%full%" %newfile%
set count=0
set words= & rem
echo "%~n1" | findstr /i /c:"music" >nul && set words=%words%, music&& set /a count+=1
echo "%~n1" | findstr /i /c:"official video" >nul && set words=%words%, official video&& set /a count+=2
set words=%words:has, =has %
set words=%words: , =%
if not %count%==0 echo "%file%" has "%words%" %count%p for music videos
set musicvideoscount=%count%
set count=0
set words= & rem
echo "%~n1" | findstr /i /c:"misinform" >nul && set words=%words%, misinform&& set /a count+=1
echo "%~n1" | findstr /i /c:"antikythera" >nul && set words=%words%, antikythera&& set /a count+=2
set words=%words:has, =has %
set words=%words: , =%
if not %count%==0 echo "%file%" has "%words%" %count%p for conspiracies
set conspiraciescount=%count%
set wanted=3
set winner=none
:loop
:: count points and set winner (in case of tie lowest in this list wins, sort accordingly)
if %conspiraciescount%==%wanted% set winner=%conspiracies%
if %musicvideoscount%==%wanted% set winner=%musicvideos%
set /a wanted+=1
if not %wanted%==15 goto loop
if not "%winner%"=="none" move "%full%" "%winner%" >nul && echo "%winner%%file%" && echo.
Notice the "weight value" for each keyword. It counts the total points for each category, finds the largest value and moves the file to the folder appointed to that category. It also displays the words it has found and lastly lists files it finds unsortable so I can add keywords or tweak weight values.
I have stripped the amount of folders and keywords in this sample to bare minimum. The full script has six folders and 64k size with all the keywords (and growing).
#ECHO OFF
SETLOCAL
SET "sourcedir=U:\sourcedir"
SET "tempfile=%temp%\somename"
SET "categories=music conspiracies"
REM SET "categories=conspiracies music"
(
FOR /f "tokens=1,2,*delims=," %%s IN (q45196316.txt) DO (
FOR /f "delims=" %%a IN (
'dir /b /a-d "%sourcedir%\*%%u*" 2^>nul'
) DO (
ECHO %%a^|%%s^|%%t
)
)
)>"%tempfile%"
SET "lastname="
FOR /f "tokens=1,2,*delims=|" %%a IN ('sort "%tempfile%"') DO (
CALL :resolve %%b %%c "%%a"
)
:: and the last entry...
CALL :resolve dummy 0
GOTO :EOF
:resolve
IF "%~3" equ "%lastname%" GOTO accum
:: report and reset accumulators
IF NOT DEFINED lastname GOTO RESET
SET "winner="
SET /a maxfound=0
FOR %%v IN (%categories%) DO (
FOR /f "tokens=1,2delims=$=" %%w IN ('set $%%v') DO CALL :compare %%w %%x
)
IF DEFINED winner ECHO %winner% %lastname:&=and%
:RESET
FOR %%v IN (%categories%) DO SET /a $%%v=0
SET "lastname=%~3"
:accum
SET /a $%1+=%2
GOTO :eof
:compare
IF %2 lss %maxfound% GOTO :EOF
IF %2 gtr %maxfound% GOTO setwinner
:: equal scores use categories to determine
IF DEFINED winner GOTO :eof
:Setwinner
SET "winner=%1"
SET maxfound=%2
GOTO :eof
You would need to change the setting of sourcedir to suit your circumstances.
I used a file named q45196316.txt containing this category data for my testing.
music,6,music
music,8,Official video
conspiracies,3,misinform
conspiracies,6,antikythera
missing,0,not appearing in this directory
I believe your problem is that repeatedly executing findstr is time-consuming.
This approach uses a data file containing lines of category,weight,mask. The categories variable contains a list of the categories in order of preference (for when the score is equal)
Read the data file, assigning category to %%s, weight to %%t and mask to %%u and then do a directory-scan using the mask. This will echo a line to the tempfile in the format name|category|weight for each name-match found. dir seems to be very fast after the first scan.
The resultant tempfile will thus have one line for each filename+category plus the weight, so if a filename fits into more than one category, more than one entry will be created.
We then scan a sorted version of that file and resolve the score.
First, if the filename changes, we can report on the last filename. This is done by comparing the values in the variables $categoryname. Since these are scanned in the order %categories% then the first category in the list is chosen if there is an equivalence of scores. The scores are then reset and lastname initialised to the new filename.
We then accumulate the score into $categoryname
So - I believe that will be a bit faster.
Revision
#ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SET "sourcedir=U:\sourcedir"
SET "tempfile=%temp%\somename"
SET "categories="rock music" music conspiracies"
REM SET "categories=conspiracies music"
:: set up sorting categories
SET "sortingcategories="
FOR %%a IN (%categories%) DO SET "sortingcategories=!sortingcategories!,%%~a"
SET "sortingcategories=%sortingcategories: =_%"
:: Create "tempfile" containing lines of name|sortingcategory|weight
(
FOR /f "tokens=1,2,*delims=," %%s IN (q45196316.txt) DO (
SET "sortingcategory=%%s"
SET "sortingcategory=!sortingcategory: =_!"
FOR /f "delims=" %%a IN (
'dir /b /a-d "%sourcedir%\*%%u*" 2^>nul'
) DO (
ECHO %%a^|!sortingcategory!^|%%t^|%%s^|%%u
)
)
)>"%tempfile%"
SET "lastname="
SORT "%tempfile%">"%tempfile%.s"
FOR /f "usebackqtokens=1,2,3delims=|" %%a IN ("%tempfile%.s") DO (
CALL :resolve %%b %%c "%%a"
)
:: and the last entry...
CALL :resolve dummy 0
GOTO :EOF
:: resolve by totalling weights (%2) in sortingcategories (%1)
:: for each name (%3)
:resolve
IF "%~3" equ "%lastname%" GOTO accum
:: report and reset accumulators
IF NOT DEFINED lastname GOTO RESET
SET "winner=none"
SET /a maxfound=0
FOR %%v IN (%sortingcategories%) DO (
FOR /f "tokens=1,2delims=$=" %%w IN ('set $%%v') DO IF %%x gtr !maxfound! (SET "winner=%%v"&SET /a maxfound=%%x)
)
ECHO %winner:_= % %lastname:&=and%
:RESET
FOR %%v IN (%sortingcategories%) DO SET /a $%%v=0
SET "lastname=%~3"
:accum
SET /a $%1+=%2
GOTO :eof
I've added a few significant comments.
You can now have spaces in category names - you need to quote the name (for reporting purposes) within the set catagories... statement.
sortingcategories is automatically derived - it's only used for sorting and is simply the categories with any space in a name replaced by an underscore.
In creating the tempfile, the category is processed to contain underscores (the sortingcategory) and when the final placement is resolved, the underscores are removed returning the category name.
Negative weights should now be processed appropriately.
-- further revision for "not append *"
FOR /f "tokens=1-5delims=," %%s IN (q45196316.txt) DO (
SET "sortingcategory=%%s"
SET "sortingcategory=!sortingcategory: =_!"
FOR %%z IN ("!sortingcategory!") DO (
SETLOCAL disabledelayedexpansion
FOR /f "delims=" %%a IN (
'dir /b /a-d "%sourcedir%\%%~v%%u%%~w" 2^>nul'
AND
add 2 extra columns to the q45196316 file
music,6,music,*,*
music,8,Official video,"",*
conspiracies,3,misinform,*,*
conspiracies,6,kythera,*anti,*
missing,0,not appearing in this directory,*,*
rock music,2,metal,*,*
conspiracies,-5,negative,*,*
The for /f ... %%s now generates %%v and %%w containing the last two columns (as tokens is nor 1-5)
These are applied as prefix and suffix to %%u in the dir command. Note that "" should be used for nothing as two successive , are parsed as a single separator. The ~ before the v/w in %%~v means remove the quotes.

Loop over an interval of files

I would like to define a for-loop (windows command line) that iterates over (numbered) intervals of files in a directory, say 1..100, and then 101..200, and 201..300 etc [Edit: regardless of the files names]. See following pseudo-code:
for %WORKDIR% %%f(1..100) in (*.htm) do (
REM DoSomething with %%f
)
for %WORKDIR% %%f(101..200) in (*.htm) do (
REM DoSomething with %%f
)
...etc
Q: Is there a way to define "numbered intervals" of files from command line?
// Rolf
You can place each function in a separate file:
:1to100
setlocal enabledelayedexpansion
set /a "file=1"
rem Skip 0 (skip=0 is omitted because it's illegal) and process 100.
for /f %%f in ('dir %workdir%\*.htm /b') do (
if !file! gtr 100 (exit /b) else (set /a "file+=1")
echo Do something with %%f.
)
endlocal
goto :eof
:100to200
setlocal enabledelayedexpansion
set /a "file=1"
rem Skip 100 and process 100.
for /f "skip=100" %%f in ('dir %workdir%\*.htm /b') do (
if !file! gtr 100 (exit /b) else (set /a "file+=1")
echo Do something with %%f.
)
endlocal
goto :eof

'if errorlevel' statement when in 'for findstr' loop

I have been unsuccessful getting the following to work. Everything works until I try to get the results of the 'findstr' in the 'for' loop. Maybe there is a better way of doing this: look for %subnet% in the masters.csv file. If it finds it, set the MSS variable to the resulting value from the 'for'. If it does not find a value, it will assign a static value (orphan). Thanks in advance for any help!!
for /f "tokens=1-2 delims=:" %%a in ('ipconfig^|find "IPv4"') do set ip=%%b
set ip=%ip:~1%
echo %ip% > ipaddress.txt
pause
for /F "tokens=1-3 delims=." %%a in ("%ip%") do set FirstThreeOctets=%%a.%%b.%%c
#REM echo First three: %FirstThreeOctets%
#echo off
setlocal
set subnet=%FirstThreeOctets%
echo %subnet%
for /f "tokens=2 delims=," %%A in ('findstr /r "^%subnet%," "\\server\APPS\appname\updates\masters.csv"') do goto OrphanCheck
#REM if errorlevel ==1 goto Orphan do set MSS=%%A
#REM echo %MSS%
#REM goto 64installcheck
:OrphanCheck
if errorlevel==1 goto Orphan
Goto NoOrphan
:NoOrphan
set MSS=%%A
Goto 64installcheck
:Orphan
set MSS=ORPHAN
echo %MSS%
pause
When you run
for /f "tokens=2 delims=," %%A in (
'findstr /r "^%subnet%," "\\server\APPS\appname\updates\masters.csv"'
) do goto OrphanCheck
two things can happen.
If findstr does not find the string, code in for loop is not executed and the next line is reached, but this line does not have access to the errorlevel generated by the findstr, it sees the errorlevel (?) of the for command.
If findstr finds the string, the goto is executed but the same scenario happens.
When the line that checks the error level is reached, another problem raises
if errorlevel==1
is a valid construct, but it does not do what it seams. It is testing if the string errorlevel is equal to the string 1. The correct sintax should be
if errorlevel 1 ....
or
if %errorlevel%==1
but as indicated, when the line is reached the errorlevel will not reflect the error of the findstr command.
And three lines later the next error.
set MSS=%%A
Once the for command has ended, its replaceable parameter does not have any value.
For a simplified version of your code
for /f "tokens=3-6 delims=.: " %%a in ('ipconfig ^| find "IPv4"') do (
set "ip=%%a.%%b.%%c.%%d"
set "subnet=%%a.%%b.%%c"
)
>"ipaddress.txt" echo %ip%
for /f "tokens=2 delims=," %%a in (
'findstr /b /c:"%subnet%," "\\server\APPS\appname\updates\masters.csv"'
) do (
set "MSS=%%a"
goto 64installcheck
)
set "MSS=ORPHAN"
echo %MSS%
pause

Resources