Search found 1694 matches

by Aacini
20 Jul 2021 10:13
Forum: DOS Batch Forum
Topic: Batch random number through C executable
Replies: 4
Views: 128

Re: Batch random number through C executable

I suggest you to review this thread. There is an assembly source program to use RDRAND CPU instruction in order to generate random numbers and its ready-to-use .exe program.

Antonio
by Aacini
25 Jun 2021 08:42
Forum: DOS Batch Forum
Topic: batch to search for duplicate letters in string
Replies: 7
Views: 415

Re: batch to search for duplicate letters in string

Code: Select all

@echo off

setlocal DisableDelayedExpansion
set "str=R#6-O0W9OXRi&FQSf1&ZcBJlwhE886D%%2CZ+-L7B+Z2khH1UG3NbDC&&Xj@TvS!DVEA1RNuWmup^HJnp$O)d!Yh(8^cVWTbF5GxN"

setlocal EnableDelayedExpansion
for /L %%i in (0,1,98) do (
   if "!str:~%%i,2!" equ "!str:~%%i,1!!str:~%%i,1!" echo !str:~%%i,2!
)
Antonio
by Aacini
12 Jun 2021 08:51
Forum: DOS Batch Forum
Topic: Get cursor position
Replies: 5
Views: 478

Re: Get cursor position

You may use my CursorPos.exe auxiliary program to both get and set cursor position. Download it from Advanced Batch features via auxiliary .exe programs.

You will also get a lot of useful auxiliary programs, like GetKey.exe, ColorShow.exe, printf.exe, etc...

Antonio
by Aacini
13 May 2021 07:25
Forum: DOS Batch Forum
Topic: Entering an "ENTER" or New_Line to load multiple lines to the Clipboard
Replies: 2
Views: 653

Re: Entering an "ENTER" or New_Line to load multiple lines to the Clipboard

Code: Select all

(echo String 01 & echo/& echo String 02 & echo/& echo String 03) | clip
Antonio
by Aacini
19 Apr 2021 22:51
Forum: DOS Batch Forum
Topic: Replace a specific character in CSV
Replies: 3
Views: 995

Re: Replace a specific character in CSV

@echo off setlocal EnableDelayedExpansion (for /F "tokens=1* delims=," %%a in (input.txt) do ( set "col1=%%a" echo !col1:-=/!,%%b )) > output.txt input.txt 68688-74747-473, Col-num-2, Col-num-3 88686-47474-374, Num-col-2, Num-col-3 output.txt 68688/74747/473, Col-num-2, Col-num-3 88686/47474/374, N...
by Aacini
16 Apr 2021 04:40
Forum: DOS Batch Forum
Topic: Set Colum for every file to txt
Replies: 3
Views: 961

Re: Set Colum for every file to txt

Do you mean: "one COLUMN for every file ? Or it should be "one GROUP OF LINES for every file"... You said: "a batch-script which first counts all files in a directory and then creates a colum like the one blow for every file". Where is the "first counts all files in a directory" section? It does not...
by Aacini
04 Apr 2021 20:21
Forum: DOS Batch Forum
Topic: JREPL to extract unique values from 16million row file?
Replies: 6
Views: 1575

Re: JREPL to extract unique values from 16million row file?

Use this code. I think it is the fastest way to get this result: @if (@CodeSection == @Batch) @then @echo off cscript //nologo //E:jscript "%~F0" < test.txt goto :EOF @end var count = new Array(); while ( ! WScript.Stdin.AtEndOfStream ) { var line = WScript.Stdin.ReadLine(); var column = line.split(...
by Aacini
04 Apr 2021 08:21
Forum: DOS Batch Forum
Topic: JREPL to extract unique values from 16million row file?
Replies: 6
Views: 1575

Re: JREPL to extract unique values from 16million row file?

I am afraid I don't understand what exactly you want. Do you want the values of the 8th position that appear just one time? (that is, in just one line) This program counts the number of times that appear each value of the 8th column: @if (@CodeSection == @Batch) @then @echo off cscript //nologo //E:...
by Aacini
25 Mar 2021 17:42
Forum: DOS Batch Forum
Topic: bat file only by computer name
Replies: 2
Views: 1368

Re: bat file only by computer name

I suggest you to not use a series of IF's at all, but directly take the value you want to start the desired batch file. Perhaps this idea can be comprehended in a simpler way if you review this code: rem Add the value of I (that can only be 1, 2 or 3) to SUM variable: IF %I% == 1 ( SET /A SUM = SUM ...
by Aacini
23 Mar 2021 20:53
Forum: DOS Batch Forum
Topic: RPN.exe: Floating-point arithmetic operations in Reverse Polish Notation
Replies: 4
Views: 2528

Re: RPN.exe: Floating-point arithmetic operations in Reverse Polish Notation

The RPN.exe user's manual is now in Spanish.

El manual de usuario de RPN.exe se encuentra ahora traducido al español en el archivo "Operaciones Aritméticas en RPN.html". Descargue la nueva versión del paquete desde esta liga.

Antonio
by Aacini
21 Feb 2021 23:11
Forum: DOS Batch Forum
Topic: Best way to setup a "Dictionary" similar to VBA?
Replies: 16
Views: 4173

Re: Best way to setup a "Dictionary" similar to VBA?

For a quick lookup list, I use the name.ext variable parsers %~n and %~x, adding a . before the lookup value like this example which expands the 3-letter abbreviation for day-of-week to the full word: @ FOR %%T in ( %DATE% )do @ FOR %%D in ( Sunday.Sun Monday.Mon Tuesday.Tue Wednesday.Wed Thursday....
by Aacini
18 Feb 2021 18:26
Forum: DOS Batch Forum
Topic: RPN.exe: Floating-point arithmetic operations in Reverse Polish Notation
Replies: 4
Views: 2528

Re: RPN.exe: Floating-point arithmetic operations in Reverse Polish Notation

A new version of RPN.exe application is ready! This new version 1.0 includes several changes, some minor, some larger... - I revised the method used to convert the 80-bits X register into an ASCII string when ENG:p format is given. Although the new method is better, it still may fail with certain va...
by Aacini
02 Feb 2021 19:35
Forum: DOS Batch Forum
Topic: Best way to setup a "Dictionary" similar to VBA?
Replies: 16
Views: 4173

Re: Best way to setup a "Dictionary" similar to VBA?

SIMMS7400 wrote:
02 Feb 2021 03:49
One last question, how do I get this value into a variable?

Code: Select all

call echo Date is : %%DATAFILENAME:~!STR[%DATAFILENAME:~0,2%].DSP!,!STR[%DATAFILENAME:~0,2%].DEP!%%

Code: Select all

call set "result=%%DATAFILENAME:~!STR[%DATAFILENAME:~0,2%].DSP!,!STR[%DATAFILENAME:~0,2%].DEP!%%"
Antonio
by Aacini
02 Feb 2021 02:10
Forum: DOS Batch Forum
Topic: Best way to setup a "Dictionary" similar to VBA?
Replies: 16
Views: 4173

Re: Best way to setup a "Dictionary" similar to VBA?

Just use a different delims char: for %%a in ("AE|UAE DLR|AE10,BE10,CE20|inbox/APAC-AE|9|4") do ( for /F "tokens=1-6 delims=|" %%A in (%%a) do ( Output: DLR: UAE DLR Entity is: AE10,BE10,CE20 FMDEE Inbox is: inbox/APAC-AE Date Start position is: 9 Date End position is: 4 Date is : 2008 Date is : 200...
by Aacini
31 Jan 2021 22:32
Forum: DOS Batch Forum
Topic: Best way to setup a "Dictionary" similar to VBA?
Replies: 16
Views: 4173

Re: Best way to setup a "Dictionary" similar to VBA?

You may use this simpler approach: @echo off setlocal EnableDelayedExpansion ::-- Definitions --:: ::DLR = Data Management Load Rule ::ENTITY = FCCS Entity ::FDMEE_INBOX = File upload repository ::DSP = Position where YYYYMM starts in data file name ::DEP = Position where YYYYMM ends in data file na...