Search found 1692 matches

by Aacini
12 Jun 2021 08:51
Forum: DOS Batch Forum
Topic: Get cursor position
Replies: 5
Views: 219

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

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

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

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

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

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

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

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

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

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

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

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

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...
by Aacini
29 Jan 2021 12:36
Forum: DOS Batch Forum
Topic: Best way to setup a "Dictionary" similar to VBA?
Replies: 16
Views: 3938

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

Simple. Just use an array:

Code: Select all

@echo off
setlocal EnableDelayedExpansion

rem Define the set of applications
set "app[AA]=Application1"
set "app[BB]=Application2"

set /P "dataFile=Enter data file: "
echo The application is: !app[%dataFile:~0,2%]!
Antonio
by Aacini
28 Jan 2021 10:10
Forum: DOS Batch Forum
Topic: RPN.exe: Floating-point arithmetic operations in Reverse Polish Notation
Replies: 4
Views: 2394

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

Yes, the RPN.exe program is entirely written in assembly language. Of course, RPN.exe expressions are similar to Forth and to any stack-based programming language. However, it was designed to be as similar as possible to the Hewlett-Packard ancient stack based calculators. I will follow your recomen...