Search found 175 matches
- 24 Jun 2012 14:28
- Forum: DOS Batch Forum
- Topic: Double quotes in For loop input [SOLVED]
- Replies: 42
- Views: 46131
Re: Double quotes in For loop input [SOLVED]
This code would work also without replacing any quotes. @echo off Setlocal EnableDelayedExpansion FOR /F "tokens=1 delims=" %%A IN (html_2.txt) DO ( set a=%%A echo a=!a! FOR /F "tokens=1-26 delims=<>" %%a in ( "!a!" ) DO ( set a=%%a& echo $:!a! set b=%%b& echo ...
- 24 Jun 2012 07:55
- Forum: DOS Batch Forum
- Topic: How to correct the condition?
- Replies: 9
- Views: 5509
Re: How to correct the condition?
Squashman wrote:What did you think it was used for?
For EXIST and DEFINED
- 23 Jun 2012 10:10
- Forum: DOS Batch Forum
- Topic: How to correct the condition?
- Replies: 9
- Views: 5509
Re: How to correct the condition?
Squashman wrote:You either use the IF NOT ==
Or use
IF NOT DEFINED
READ THE HELP FILE FOR THE IF COMMAND!.!
Sure I know there exists NOT keyword, but did not realize I could use it to reverse operator!!!!
Thanks!
- 23 Jun 2012 07:59
- Forum: DOS Batch Forum
- Topic: How to correct the condition?
- Replies: 9
- Views: 5509
Re: How to correct the condition?
So Should I use SET /A for boolean instead? NEQ will not work for string comparation, am I right?
- 23 Jun 2012 07:45
- Forum: DOS Batch Forum
- Topic: How to correct the condition?
- Replies: 9
- Views: 5509
How to correct the condition?
I'm finishing the script from this thread: http://www.dostips.com/forum/viewtopic.php?f=3&t=3435 After I parsed the tags, I have found IP, port, country, server type and anonymity. Sometimes the type is HTTPS which I am not interested so type is empty SET type= . Also if the anonymity is medium ...
- 22 Jun 2012 14:29
- Forum: DOS Batch Forum
- Topic: Double quotes in For loop input [SOLVED]
- Replies: 42
- Views: 46131
Re: Double quotes in For loop input [SOLVED]
The code does not contain \q. For me, the point is that I have found where was the problem. Better solution for me is to remove double quotes because I don't need them in the script for detection of numbers.
- 22 Jun 2012 01:12
- Forum: DOS Batch Forum
- Topic: Double quotes in For loop input [SOLVED]
- Replies: 42
- Views: 46131
SOLVED
Scott R from stackoverflow solved the question: m Here is shortened version of Scott R's code: @echo off Setlocal EnableDelayedExpansion FOR /F "tokens=1 delims=" %%A IN (html_2.txt) DO ( set a=%%A set a=!a:"=\q! echo a=!a! FOR /F "tokens=1-26 delims=<>" %%A in ( "!a!&q...
- 18 Jun 2012 12:16
- Forum: DOS Batch Forum
- Topic: Double quotes in For loop input [SOLVED]
- Replies: 42
- Views: 46131
Notes
This is the most problematic part L.581-585: * * - m Blue parts of the code are debugging part of the echo command. The dollar - $: marks the value of $ variable, which should be the derived column/token from the second loop without quotes. Here I look for number values, without quotes. This fails i...
- 18 Jun 2012 12:16
- Forum: DOS Batch Forum
- Topic: Double quotes in For loop input [SOLVED]
- Replies: 42
- Views: 46131
Double quotes in For loop input [SOLVED]
@echo off Setlocal EnableDelayedExpansion SET proxy_3=hide_2.htm FOR %%Z IN (hide_2.htm) DO ( FOR /F "tokens=1-20 delims=<>" %%A IN ('grep -B 1411 -E "</table>" %%Z ^| grep -E ^"^(display^|^^\d\d{1,3}^|country^|^<td^>HTTP^|rightborder^).*$^" ') DO ( echo A:%%A + B:%%B ...
- 18 Jun 2012 03:01
- Forum: DOS Batch Forum
- Topic: How to detect number
- Replies: 18
- Views: 9404
Re: How to detect number
Need help again. Do you remember, you have written this loop: FOR %%Z IN (hide_2.htm) DO ( FOR /F "tokens=1-20 delims=<>" %%A IN ('grep -B 1411 -E "</table>" %%Z ^| grep -E ^"^(display^|^^\d\d{1,3}^|country^|^<td^>HTTP^|rightborder^).*$^" ') DO ( FOR %%? in ( "%%~A...
- 17 Jun 2012 12:28
- Forum: DOS Batch Forum
- Topic: How to detect number
- Replies: 18
- Views: 9404
Re: How to detect number
Ed Dyreen wrote:'Code: Select all
@echo off
set /a 1
Did you mean:
SET /a firstNumber=1
SET /a firstNumber=0
It works Thanks
- 17 Jun 2012 09:50
- Forum: DOS Batch Forum
- Topic: How to detect number
- Replies: 18
- Views: 9404
Re: How to detect number
Can you explain to me why this does not work? if defined second ( SET ThisIsLegalNumber=0 if !second! equ +!second! ( if not defined firstNumber ( SET firstNumber=1 ) else ( SET firstNumber=0 ) ECHO FIRST NUMBER: ECHO firstNumber: !firstNumber! ECHO $ is !$! , second is !second! if !firstNumber! eq...
- 17 Jun 2012 04:01
- Forum: DOS Batch Forum
- Topic: How to detect number
- Replies: 18
- Views: 9404
Re: How to detect number
Can you explain to me why this does not work? if defined second ( SET ThisIsLegalNumber=0 if !second! equ +!second! ( if not defined firstNumber ( SET firstNumber=1 ) else ( SET firstNumber=0 ) ECHO FIRST NUMBER: ECHO firstNumber: !firstNumber! ECHO $ is !$! , second is !second! if !firstNumber! equ...
- 16 Jun 2012 11:47
- Forum: DOS Batch Forum
- Topic: How to detect number
- Replies: 18
- Views: 9404
Re: How to detect number
Does the question mark mean the same as dollar? It will take some time till I will test it.
It is very interesting idea to do it this way. I would continue tomorrow. Thanks
It is very interesting idea to do it this way. I would continue tomorrow. Thanks
- 16 Jun 2012 11:17
- Forum: DOS Batch Forum
- Topic: How to detect number
- Replies: 18
- Views: 9404
Re: How to detect number
I have this simplified code: SET E=%%E if "%%E" neq "." ( SET first=!E:~0,1! if "first"=="." ( SET number=!E:~1,0! ) else ( SET number=%%E ) ) else ( SET dot=. ) if defined number if !number! equ +!number! echo. isNumber: '!E!' I hope there is not error. Now I...