Search found 1620 matches

by Aacini
06 Feb 2019 05:38
Forum: DOS Batch Forum
Topic: Manage multiple databases services using batch script
Replies: 16
Views: 2469

Re: Load multiple parameters from file

I tried this. It works. This is the _list.log file: word1 word2 word3 This is the par.bat Batch file: @echo off setlocal EnableDelayedExpansion set /a cnt=0 for /f %%G in (_list.log) do (set /a cnt+=1 & set "param!cnt!=%%G") set param echo %param1% This is the output: C:\Users\Antonio\Documents\test...
by Aacini
05 Feb 2019 11:20
Forum: DOS Batch Forum
Topic: Manage multiple databases services using batch script
Replies: 16
Views: 2469

Re: Load multiple parameters from file

.... in other words:

Try to insert this line:

Code: Select all

echo %param1%
at end of par.bat :roll:

Antonio
by Aacini
31 Jan 2019 19:34
Forum: DOS Batch Forum
Topic: An easy set calculation
Replies: 2
Views: 805

Re: An easy set calculation

@echo off setlocal :loop set "num=" set /P "num=Enter integer number: " if not defined num goto :EOF set /A "div=num*80" echo %num% / 1.25 = %div:~0,-2%.%div:~-2% goto loop Example: Enter integer number: 10 10 / 1.25 = 8.00 Enter integer number: 100 100 / 1.25 = 80.00 Enter integer number: 1000 100...
by Aacini
27 Jan 2019 19:54
Forum: DOS Batch Forum
Topic: Check and identify Lin Files by contents
Replies: 4
Views: 911

Re: Check and identify Lin Files by contents

In your first post you said: "My need is to check contents of each file and to identify 100% duplicate files" . Now you changed the requirement to "i wish to check files of different sizes also to find if same text appears" . This is an entirely different problem... I strongly suggest you to read th...
by Aacini
27 Jan 2019 12:43
Forum: DOS Batch Forum
Topic: delete files in Folder with version-stamp
Replies: 4
Views: 1000

Re: delete files in Folder with version-stamp

I am afraid I don't understand your requirement... Do you want to remove all files with the same string before the underscore, excepting the last one? If so, then you may try this solution: @echo off setlocal EnableDelayedExpansion set "group=" for /F "tokens=1* delims=_" %%a in ('dir /A-D /B *.pdf'...
by Aacini
25 Jan 2019 08:47
Forum: DOS Batch Forum
Topic: How to store %Errorlevel% to variable for later use?
Replies: 2
Views: 835

Re: How to store %Errorlevel% to variable for later use?

In this command there is a pipe : type foo.log | findstr /r /c:"\<!-- foo:1 --\>" >nul The pipe is executed via a new instance of cmd.exe at each side of the pipe. When the pipe (both commands) ends, the errorlevel in each one of the two executed cmd.exe's is lost. Just use it this way: findstr /r /...
by Aacini
24 Jan 2019 14:05
Forum: DOS Batch Forum
Topic: How to enumerate used and free file handles
Replies: 3
Views: 882

Re: How to enumerate used and free file handles

I enjoyed your description a lot! :D

This may sound somewhat pedantic but, it seems to me that I was reading one of my descriptions! :wink: :roll:

Antonio
by Aacini
23 Jan 2019 16:45
Forum: DOS Batch Forum
Topic: Manipulating a variable
Replies: 2
Views: 703

Re: Manipulating a variable

I would do it this way: @echo off SET "CLOUD_URL=https://planning-z552xxx1.pbcs.us2.oraclecloud.com" if "%CLOUD_URL:-test=%" equ "%CLOUD_URL%" ( set "CLOUD_URL=%CLOUD_URL:planning=planning-test%" ) else ( set "CLOUD_URL=%CLOUD_URL:-test=%" ) echo %CLOUD_URL% If you need the "test" string to be in a ...
by Aacini
17 Jan 2019 09:56
Forum: DOS Batch Forum
Topic: Foldername first letter of filename
Replies: 3
Views: 816

Re: Foldername first letter of filename

Mmmm.... Why do you need the first letter of the filename? Are not all files that start with "A" in a folder named "A"? And the same for the rest of letters?

Antonio
by Aacini
10 Jan 2019 15:00
Forum: DOS Batch Forum
Topic: Batch file help. Needing to position windows.
Replies: 15
Views: 2319

Re: Batch file help. Needing to position windows.

A simple way? What about this one?

Code: Select all

Window GPos x y
The Window.exe file is 4096 bytes size, that is 4 KB, and it can be created from a Batch file in a very simple way...

Antonio
by Aacini
09 Jan 2019 10:24
Forum: DOS Batch Forum
Topic: Batch file help. Needing to position windows.
Replies: 15
Views: 2319

Re: Batch file help. Needing to position windows.

... and also my Window.exe auxiliary .exe program, that is much smaller...

Antonio
by Aacini
05 Jan 2019 12:32
Forum: DOS Batch Forum
Topic: Split text file at start marker and blank line or just start marker into multiple files
Replies: 9
Views: 1570

Re: Split text file at start marker and blank line or just start marker into multiple files

Simpler... @echo off setlocal EnableDelayedExpansion set "last=1" < Dialog.rc ( for /F "tokens=1,2 delims=: " %%a in ('(type Dialog.rc ^& echo 0 DIALOG^) ^| findstr /N /R /C:"^[0-9][0-9]* DIALOG"') do ( set /A "lines=%%a-last, last=%%a" if !lines! gtr 0 ( set /P "line=" for /L %%i in (2,1,!lines!) d...
by Aacini
30 Dec 2018 09:34
Forum: DOS Batch Forum
Topic: For /f processing delimited string
Replies: 4
Views: 976

Re: For /f processing delimited string

If you have the target string in a variable, and the substrings have not ? * wild-card characters, then you may use this simple trick:

Code: Select all

set "var=123?456?789"
for %A in ("%var:?=" "%") do echo %~A
Antonio
by Aacini
02 Dec 2018 10:41
Forum: DOS Batch Forum
Topic: Parsing taking FOREVER - possible JSCRIPT solution?
Replies: 6
Views: 1060

Re: Parsing taking FOREVER - possible JSCRIPT solution?

I suggest you to also test my first code. You may get the time that both methods takes and post they (and also the time that your original code takes). IMHO this topic is about efficiency . Isn't it? So this point should take full attention (not just to get the correct result). I am very interested ...
by Aacini
02 Dec 2018 09:04
Forum: DOS Batch Forum
Topic: Parsing taking FOREVER - possible JSCRIPT solution?
Replies: 6
Views: 1060

Re: Parsing taking FOREVER - possible JSCRIPT solution?

Another method that have not the restrictions of my previous one... @echo off setlocal EnableDelayedExpansion rem Extract desired values (for /F "tokens=2 delims=|" %%a in (FDRII_outline.txt) do ( set "value=%%~a" if "!value:~0,2!" equ "C-" echo !value! )) > out1.txt rem Sort desired values (this is...