Search found 1598 matches

by Aacini
11 Jul 2019 22:15
Forum: DOS Batch Forum
Topic: Multi-line menu with options selection via DOSKEY
Replies: 7
Views: 4215

Re: Multi-line menu with options selection via DOSKEY

I reviewed this program and fixed the problem about the reinitialization of DOSKEY history. It works correctly now. Then, I wrote an example of a menu to start real programs. When the programs are console applications, everything is OK. However, when the programs are GUI applications, then may be a ...
by Aacini
28 Jun 2019 12:15
Forum: DOS Batch Forum
Topic: Cmdgfx - draw 3d and graphic primitives (polygons,circles etc) in cmd window (now with 24-bit RGB support!)
Replies: 105
Views: 31417

Re: Cmdgfx - draw 3d and graphic primitives (polygons,circles etc) in cmd window (now with 24-bit RGB support!)

Wow! The writing of text is fantastic! This remembers me my old method to write text in pixel mode. Where do you get the definition of the raster fonts, so you can read them?

Antonio
by Aacini
21 Jun 2019 15:27
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.3 - regex text processor with support for text highlighting and alternate character sets
Replies: 428
Views: 174995

Re: JREPL.BAT v8.2 - regex text processor with support for text highlighting and alternate character sets

Mmmm... If you may change the format of both input files, then there is a very simple solution: target.txt: There is !a! apple Now there were !b! apples before In the beginning there were !c! apples definition.txt: a=one b=two c=three test.bat: @echo off setlocal EnableDelayedExpansion rem Read stri...
by Aacini
05 Jun 2019 08:54
Forum: DOS Batch Forum
Topic: Batch file runs differently when executed line by line
Replies: 6
Views: 903

Re: Batch file runs differently when executed line by line

At this topic there is a detailed description of the differences of execute commands inside a Batch.bat file vs directly at the command line. Perhaps you may want to review it, but be warned that such a topic quickly changes into an esoteric subject! :shock: :wink:

Antonio
by Aacini
04 May 2019 10:50
Forum: DOS Batch Forum
Topic: How to preserve exact number of space characters after split by for
Replies: 2
Views: 196

Re: How to preserve exact number of space characters after split by for

Don't use usebackq switch and enclose the variable in quotes:

Code: Select all

@echo off

:test2
setlocal DisableDelayedExpansion

set "line1=   abc   #   %%var1%%   #   ^!var2^!"


for /f "delims=# tokens=1,2,3*" %%i in ("%line1%") do (
	echo {%%i}
	echo {%%j}
	echo {%%k}
)

endlocal
goto :eof
Antonio
by Aacini
27 Apr 2019 06:28
Forum: DOS Batch Forum
Topic: Color Ascii Art
Replies: 8
Views: 7819

Re: Color Ascii Art

@lylalandry, I clearly explained the process in my post... Can't you see the same paragraphs I wrote? :? ..... I searched the web for an Image-to-Ascii Art conversion program. After a short search, I got Ascii Generator 2 . I have not time to do extensive searching and testing, so I don't know if th...
by Aacini
26 Apr 2019 09:43
Forum: DOS Batch Forum
Topic: using for loop and delims to extract a substring
Replies: 6
Views: 372

Re: using for loop and delims to extract a substring

Code: Select all

@echo off
setlocal

set "$html=<source src="http://videos.dummysite.com/videos/video01.mp4" type="video/mp4"/>"

set "x=%$html: =" & set "%"

echo %src:~1,-1%
Antonio
by Aacini
08 Apr 2019 10:35
Forum: DOS Batch Forum
Topic: Cut text after nth comma using batch script
Replies: 1
Views: 195

Re: Cut text after nth comma using batch script

Another way to say the same thing is that you want the first and second tokens delimited by comma, isn't it?

Code: Select all

for /F "tokens=1,2 delims=," %%a in ("theFile.txt") do echo %%a,%%b
Antonio
by Aacini
05 Apr 2019 09:55
Forum: DOS Batch Forum
Topic: how to make an array by function and by local variable of the function
Replies: 5
Views: 496

Re: how to make an array by function and by local variable of the function

@echo off set /a n=99 call :test3 ret echo show array: echo %ret.Array[0]% echo %ret.Array[1]% echo %ret.Array[2]% echo %ret.Array[3]% ECHO Press any key to close the windows... pause>NUL goto :eof :test3 setlocal for /L %%i in (0,1,3) do set "%~1.Array[%%i]=V%%i" set localEnv=1 for /F %%v in ('set...
by Aacini
05 Apr 2019 09:44
Forum: DOS Batch Forum
Topic: Convert 1111 2222 3333 in \x11\x11\x22\x22\x33\x33
Replies: 9
Views: 677

Re: Convert 1111 2222 3333 in \x11\x11\x22\x22\x33\x33

... and you also should read the very first post in this forum... @echo off setlocal EnableDelayedExpansion (for /F "delims=" %%a in (input.txt) do ( set "line=" for %%b in (%%a) do ( set "num=%%b" set "line=!line!\x!num:~0,2!\x!num:~2! ) echo !line! )) > output.txt move /Y output.txt input.txt Anto...
by Aacini
04 Apr 2019 14:26
Forum: DOS Batch Forum
Topic: Lag methodology
Replies: 9
Views: 866

Re: Lag methodology

That code allows you to generate a series of dates in both upward (future dates) and downward (past dates) from a base date.

Antonio
by Aacini
02 Apr 2019 07:19
Forum: DOS Batch Forum
Topic: Lag methodology
Replies: 9
Views: 866

Re: Lag methodology

by Aacini
28 Mar 2019 13:17
Forum: DOS Batch Forum
Topic: Need help with a game
Replies: 2
Views: 289

Re: Need help with a game

Something like this, perhaps? @echo off setlocal EnableDelayedExpansion set "Answer1.1=Hello Roger, I am the employee responsible for your file" set "Answer1.2=I will not go there four ways, you will die if you do not convince me otherwise^!" set "Answer1.3=Terminate these questions" cls :loop echo/...
by Aacini
20 Mar 2019 10:29
Forum: DOS Batch Forum
Topic: Generating consecutive dates
Replies: 1
Views: 422

Generating consecutive dates

In some Batch-file applications the generation of consecutive dates is needed. The usual way to solve this problem is converting the base date to a Julian Day Number, increment/decrement this number by one and then convert it back to date. Other suggested method is using other languages that nativel...
by Aacini
19 Mar 2019 16:24
Forum: DOS Batch Forum
Topic: Lag methodology
Replies: 9
Views: 866

Re: Lag methodology

I would like to present a simpler approach: @echo off setlocal EnableDelayedExpansion set /P "YYYYMMDD=Enter date in YYYYMMDD format: " set /P "days=Enter number of days: " set /A "DD=100+(D=YYYYMMDD%%100), YYYYMM=YYYYMMDD/100, MM=100+(M=YYYYMM%%100), YYYY=YYYYMM/100 for /L %%i in (1,1,%days%) do ( ...