Search found 19 matches

by fugitive
10 Jul 2017 08:22
Forum: DOS Batch Forum
Topic: How do I randomly display a column in one of the lines?
Replies: 4
Views: 780

Re: How do I randomly display a column in one of the lines?

Okay. In this case that code might be working. Steffen Perfect, Steffen! Thanks very much. would like to tell me why my own batfile can not work ? @echo off cd /d %~dp0 setlocal enabledelayedexpansion set file=test.txt for /f "delims=" %%a in ('type "%file%"') do set /a Line+=1 ...
by fugitive
09 Jul 2017 08:09
Forum: DOS Batch Forum
Topic: How do I randomly display a column in one of the lines?
Replies: 4
Views: 780

Re: How do I randomly display a column in one of the lines?

What does "column" mean? How are columns separated in your text file? Or do they have a fixed length? Steffen HI Steffen The columns separated by the space bar.It looks like this : cold HX 16 aa bb water HQ 16 aa bc safe HGS\HES\HG6A\HE2 12-16 aa bc white HC4A 14 aa bc thin HG3 12 aa bc d...
by fugitive
08 Jul 2017 09:14
Forum: DOS Batch Forum
Topic: How do I randomly display a column in one of the lines?
Replies: 4
Views: 780

How do I randomly display a column in one of the lines?

Hey,good evening everyone,i need your help.
I have a text file with 20 lines. How do I randomly display a column in one of these lines?
and when i press any key,it display all the contents of that row.

(The text has 5 columns per line)
by fugitive
11 Apr 2017 20:52
Forum: DOS Batch Forum
Topic: A question about permutations and combinations.
Replies: 6
Views: 1330

Re: A question about permutations and combinations.

penpen wrote:If you want the program to work as fast as possible, then you may want to create a macro (== command pre built in environment variable);
here is an example ("listPermuation.bat") with no input functionality:

Thank you very much,Penpen. You've done me a great favor !
by fugitive
08 Apr 2017 20:31
Forum: DOS Batch Forum
Topic: A question about permutations and combinations.
Replies: 6
Views: 1330

Re: A question about permutations and combinations.

See this or this ... Antonio Thanks, but that's too slow,when I type 123456, it takes about one minute. I worte some code, but the function is not strong, it needs to enter with space, and can not rule out duplicate items. The advantage is more faster.I type “1 2 3 4 5 6”,it takes about 8 seconds. ...
by fugitive
08 Apr 2017 18:37
Forum: DOS Batch Forum
Topic: A question about permutations and combinations.
Replies: 6
Views: 1330

Re: A question about permutations and combinations.

penpen wrote:The answer is 6! (=720); for further information see:
https://en.wikipedia.org/wiki/Factorial.


penpen


Sorry, I did't have a clear description about my question,in fact, I want to use batch to list the all combination of the 6 numbers
by fugitive
08 Apr 2017 08:11
Forum: DOS Batch Forum
Topic: A question about permutations and combinations.
Replies: 6
Views: 1330

A question about permutations and combinations.

Just enter any 6 numbers , How many different combinations can they make?
for example, I input 3numbers "1\3\2",there could be "123 132 213 231 312 321"
How about "6" numbers ,Could you help me ?
by fugitive
16 Mar 2017 10:24
Forum: DOS Batch Forum
Topic: how to use code to create a Pyramid
Replies: 30
Views: 5705

how to use code to create a Pyramid

As picture shown, shows a Pyramid of letter A (With batch processing, whose code will be the shortest ) —————————————————————————— this is my code,too long,haha @echo off set "s= AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" for /l %%i in (1,1,40) do ( call,echo,%%s:~%%i,%%i%% ) pause ——————...
by fugitive
16 Mar 2017 10:12
Forum: DOS Batch Forum
Topic: how can i find the Invisible txtfile about File Streams
Replies: 2
Views: 875

how can i find the Invisible txtfile about File Streams

I wonder if you have found this interesting way to hide some things in your computer files @echo off echo;hello dostips>a.txt:s.txt echo;Do you know where is the word? for /f "delims=" %%a in (a.txt:s.txt) do echo;%%a echo;maybe we can write our codes into a invisible batchfile Of course, ...
by fugitive
15 Mar 2017 07:25
Forum: DOS Batch Forum
Topic: Using many "tokens=..." in FOR /F command in a simple way
Replies: 59
Views: 21806

Re: Using many "tokens=..." in FOR /F command in a simple way

Hi.Aacini I am very interested in your question.So I wrote some code as follow But my English is not very good, so there might be some misunderstanding about your problem, please forgive me @echo off setlocal enabledelayedexpansion set /p tok=tokens=: for /f %%a in ('findstr .* test.txt^|find /v /c ...
by fugitive
13 Mar 2017 08:00
Forum: DOS Batch Forum
Topic: Save/Load Help
Replies: 8
Views: 1547

Re: Save/Load Help

Sounak@9434 wrote:

Code: Select all

@echo off
set answer=#
if # geq 5 echo WHAT
if # leq 5 echo NOOO
pause>nul


Oh my God, that's my fault. It should be # lss 0
by fugitive
13 Mar 2017 05:46
Forum: DOS Batch Forum
Topic: Save/Load Help
Replies: 8
Views: 1547

Re: Save/Load Help

Squashman pointed out a syntax error of you,and i found another small mistake. echo 1. New Account echo 2. Singleplayer echo 3. Multiplayer echo 4. Exit echo. set /p answer= Enter the number next to the option you want: if %answer% GEQ 5 ( if you input # @ $ ? ,you find # gtr 5 too!Maybe you could u...
by fugitive
13 Mar 2017 05:07
Forum: DOS Batch Forum
Topic: fast way to find empty folders?
Replies: 6
Views: 2113

Re: fast way to find empty folders?

Or,try this code

Code: Select all

for /f "delims=" %%a in ('dir /ad /b /s') do rd "%%~a"&& (md "%%~a" &cd.>%%~a\empty_folder.txt )



My friend told me : Alway try to avoid using “find\findstr”.
by fugitive
13 Mar 2017 00:24
Forum: DOS Batch Forum
Topic: How to center align text.
Replies: 30
Views: 6578

Re: How to center align text.

Edit your post fugitive, that method is shown by einstein1969, not me. [Offtopic] By the way, is the poem written by you fugitive? [/Offtopic] Thanks for reminding. haha……I learned from both of you “Tokens” ignore space character in front of line,and einstein 1969 's code does not need to calculate...
by fugitive
13 Mar 2017 00:04
Forum: DOS Batch Forum
Topic: fast way to find empty folders?
Replies: 6
Views: 2113

Re: fast way to find empty folders?

How about this one,The code is more complex, but not used "find". @echo off for /f "delims=" %%a in ('dir /ad /b /s target') do call :check "%%a" pause&exit /b :check set "ept=" for /f "delims=" %%b in ('dir /a /b "%~1"') do set ept=no ...