Search found 11 matches

by J'aitreschaud
13 Nov 2018 21:29
Forum: DOS Batch Forum
Topic: Strange behaviour with ansi sequence
Replies: 3
Views: 4352

Re: Strange behaviour with ansi sequence

@IcarusLives @jeb
Thank you both for your answers.
Also IcarusLives, I love your username; great reference.
by J'aitreschaud
12 Nov 2018 23:05
Forum: DOS Batch Forum
Topic: Strange behaviour with ansi sequence
Replies: 3
Views: 4352

Strange behaviour with ansi sequence

Bonjour everyone. I recently found out bout ansi escape sequences and I found this strange behaviour. I have this code: @echo off for /f %%A in ('echo prompt $E^| cmd') do set "ESC=%%A" echo %ESC%[100m pause It should make the background grey. However, it seems like only the text's background is gre...
by J'aitreschaud
24 Jul 2018 14:03
Forum: DOS Batch Forum
Topic: Setting each line of a txt file to a variable is not working
Replies: 7
Views: 5911

Re: Setting each line of a txt file to a variable is not working

Hehe, I see your point. I think I was just being stupid, and was dumb enough not to realize that it was the method at the core :oops:
by J'aitreschaud
23 Jul 2018 18:27
Forum: DOS Batch Forum
Topic: Setting each line of a txt file to a variable is not working
Replies: 7
Views: 5911

Re: Setting each line of a txt file to a variable is not working

Merci beacoup Shadowthief.
To answer your question aGerman, I didn't really want tons of extra txt files for the stuff I was doing, so I just wanted one file for everything instead.
by J'aitreschaud
23 Jul 2018 16:51
Forum: DOS Batch Forum
Topic: Setting each line of a txt file to a variable is not working
Replies: 7
Views: 5911

Re: Setting each line of a txt file to a variable is not working

Thank you so much AGerman! It worked like a charm. I also have one small question. I have this code: setlocal enabledelayedexpansion set n=1 for /f "tokens=* delims=:@" %%L in ('findstr /bl :::@ "%~f0"') do ( set Line!n!=%%L set /a n+=1 ) pause Theoretically, it takes each line with ":::@" before it...
by J'aitreschaud
23 Jul 2018 13:18
Forum: DOS Batch Forum
Topic: Setting each line of a txt file to a variable is not working
Replies: 7
Views: 5911

Setting each line of a txt file to a variable is not working

Salut tout le monde! I have a problem with setting each line of a txt file to a variable. All the variables have a blank value, whichever method I try. The txt file (Input.txt)contains this: Panda Hello Icebear Hey I've tried multiple methods, none of which work like this one: setlocal enabledelayed...
by J'aitreschaud
04 Jul 2018 13:11
Forum: DOS Batch Forum
Topic: Help with set /a
Replies: 5
Views: 5415

Re: Help with set /a

@Squashman Sorry for ignoring your answer, its just that the time I saw your answer was on mobile; while when I saw Dave's answer I was on my PC, so I looked at his advice. Thank you a lot for posting a reply, it works! :)
by J'aitreschaud
04 Jul 2018 09:14
Forum: DOS Batch Forum
Topic: Help with set /a
Replies: 5
Views: 5415

Re: Help with set /a

Thanks for the reply dbenham! However, it still auto-closes with the same message:"/ was unexpected at the time" I've tried putting a caret before the ), but it doesn't work. FOR /L %%G IN (1,1,6) DO ( SET /A rand%%G=%RANDOM% * (5 - 1 + 1^) / 32768 + 1 ^) Neither does this FOR /L %%G IN (1,1,6) DO (...
by J'aitreschaud
03 Jul 2018 21:57
Forum: DOS Batch Forum
Topic: Help with set /a
Replies: 5
Views: 5415

Help with set /a

I have another question. Hopefully this gets answered... I have this: FOR /L %%G IN (1,1,6) DO ( SET /A rand%%G=%RANDOM% * (5 - 1 + 1) / 32768 + 1 ) But for the life of me, I can't figure out why it doesn't work. It displays the error message :"/ was unexpected at the time". I really see no error ho...
by J'aitreschaud
02 Jul 2018 10:36
Forum: DOS Batch Forum
Topic: Help with findstr
Replies: 3
Views: 3977

Re: Help with findstr

@penpen Thanks :)
@Sqaushman Your solution worked! Thank you so much :mrgreen:
by J'aitreschaud
01 Jul 2018 21:48
Forum: DOS Batch Forum
Topic: Help with findstr
Replies: 3
Views: 3977

Help with findstr

Bonjour everyone. I'm having a problem with findstr right now. I have some text like this: :::. Path is :::. Your name is :::. Folder is And I use this to output the text. FOR /F "tokens=* delims=:." %%H in (findstr /bl :::. "%~f0"') do @echo %%H It works fine. At the top, I also have this code: SET...