Search found 1609 matches

by Aacini
04 Mar 2019 08:50
Forum: DOS Batch Forum
Topic: Cardioid - Heart Curve
Replies: 6
Views: 986

Re: Cardoid - Heart Curve

Ops! You are using ANSI sequences to move the cursor... :(

This just works in Windows 10, or with an ANSI driver installed. :cry:

Antonio
by Aacini
01 Mar 2019 09:59
Forum: DOS Batch Forum
Topic: How to eliminate the spaces in a line in a text file
Replies: 9
Views: 1311

Re: How to eliminate the spaces in a line in a text file

Simpler: @echo off setlocal EnableDelayedExpansion (for /F "delims=" %%a in (input.txt) do ( set "input=%%a" if "!input:~40!" equ "" ( echo(!input! ) else ( set "output=!input:~0,1!" if "!output!" neq " " set "output=" for %%b in (!input!) do set "output=!output!%%b " echo(!output:~0,-1! ) )) > outp...
by Aacini
28 Feb 2019 20:06
Forum: DOS Batch Forum
Topic: How to eliminate the spaces in a line in a text file
Replies: 9
Views: 1311

Re: How to eliminate the spaces in a line in a text file

Several comments about your "question": Your example is incorrect. Line 1 is 78 chars, not < 40 I suppose that with "replace all the spaces with single space" you really want to say "replace all groups of adjacent spaces with single space". If so, then: Lines 4 and 5 in the output example are wrong,...
by Aacini
13 Feb 2019 09:38
Forum: DOS Batch Forum
Topic: Set Window Topmost (Powershell hybrids)
Replies: 4
Views: 817

Re: Set Window Topmost (Powershell hybrids)

You may precompile all DLL files and keep the class definitions open in a resident PowerShell code, so the posterior usage of the Windows API's is very fast. The technique is described at Read arrow keys and show color text in an efficient way.

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

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: 1741

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: 576

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: 634

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: 715

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: 617

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: 663

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: 521

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: 587

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: 1689

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: 1689

Re: Batch file help. Needing to position windows.

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

Antonio