Search found 36 matches
- 18 Aug 2008 10:36
- Forum: DOS Batch Forum
- Topic: Handling Dates - Only checking Day and not all Date
- Replies: 6
- Views: 11234
- 18 Aug 2008 05:57
- Forum: DOS Batch Forum
- Topic: Handling Dates - Only checking Day and not all Date
- Replies: 6
- Views: 11234
1. Check that you have the right date format - if you do echo %date% I assume you date format is dd-mm-yyyy This can vary - mine is dd/mm/yyyy 2. You first section: IF %DATE% EQU 01-01-2008 GOTO NORMAL if %date% GTR 23-09-2008 GOTO SIM The first line is EQU so NORMAL is only used if date = 01-01-200...
- 17 Aug 2008 18:45
- Forum: DOS Batch Forum
- Topic: Multiple commands per line
- Replies: 5
- Views: 16256
See http://technet.microsoft.com/en-us/libr ... 37438.aspx
&& means 'do the next one if the last one completed OK'
&& means 'do the next one if the last one completed OK'
- 17 Aug 2008 10:40
- Forum: DOS Batch Forum
- Topic: String Manipulation Error
- Replies: 2
- Views: 7015
- 17 Aug 2008 10:27
- Forum: DOS Batch Forum
- Topic: String Manipulation/String Tokenization in DOS
- Replies: 5
- Views: 11195
- 13 Aug 2008 11:00
- Forum: DOS Batch Forum
- Topic: extracting directory name from list
- Replies: 1
- Views: 5972
Hi Oh, I'm not sure what you are aiming to get from this first line: set filelist=.\anc_extraction_fifo11x512_fast_behavioral.bat .\anc_extract_divi\anc-out-y_in.txt Is .\anc_extraction_fifo11x512_fast_behavioral.bat supposed to do something to .\anc_extract_divi\anc-out-y_in.txt to generate a filel...
- 13 Aug 2008 10:56
- Forum: DOS Batch Forum
- Topic: String Manipulation/String Tokenization in DOS
- Replies: 5
- Views: 11195
Does this help?:
This page is very useful:
http://www.dostips.com/DtTipsStringMani ... LeftString
Code: Select all
FOR /F "TOKENS=1,2 DELIMS=_." %%a IN ("file_somenamev1.3.zip") do (set token2=%%b)
set fourchars=%token2:~0,4%
echo %fourchars%
This page is very useful:
http://www.dostips.com/DtTipsStringMani ... LeftString
- 23 Jul 2008 20:50
- Forum: DOS Batch Forum
- Topic: Ignore blank lines and set lines to variables
- Replies: 1
- Views: 9594
- 23 Jul 2008 11:12
- Forum: DOS Batch Forum
- Topic: "FOR" help
- Replies: 5
- Views: 11353
- 21 Jul 2008 06:40
- Forum: DOS Batch Forum
- Topic: "FOR" help
- Replies: 5
- Views: 11353
I found this very useful:
http://www.robvanderwoude.com/for.html
It helps to think:
FOR every TOKEN in (list, file, whatever) DO (something involving the token)
That's the basic format. The delims=, tokens= and so on basically let you get the right token to do things to - worry about that later.
http://www.robvanderwoude.com/for.html
It helps to think:
FOR every TOKEN in (list, file, whatever) DO (something involving the token)
That's the basic format. The delims=, tokens= and so on basically let you get the right token to do things to - worry about that later.
- 21 Jul 2008 06:34
- Forum: DOS Batch Forum
- Topic: Brackets with If & For commands
- Replies: 2
- Views: 7441
- 17 Jul 2008 10:55
- Forum: DOS Batch Forum
- Topic: String variable substitution
- Replies: 7
- Views: 12436
This explains it quite well: m Instead of % you use ! to indicate a variable but these are only recognised if you use setlocal ENABLEDELAYEDEXPANSION In the case of set refoutput=!output:%nextcommand% =! it delays the expansion of !output! until it's expanded %nextcommand% The space before the =! is...
- 17 Jul 2008 10:46
- Forum: DOS Batch Forum
- Topic: move Files from different folders
- Replies: 1
- Views: 5942
- 17 Jul 2008 10:24
- Forum: DOS Batch Forum
- Topic: Remove pattern from end of line?
- Replies: 1
- Views: 5499
- 17 Jul 2008 10:15
- Forum: DOS Batch Forum
- Topic: String variable substitution
- Replies: 7
- Views: 12436
Got it. I had wanted to something like this a few weeks ago, and only just worked it out now - so thank you!
Code: Select all
setlocal ENABLEDELAYEDEXPANSION
set output=%*
set nextcommand=%1 %2
set refoutput=!output:%nextcommand% =!
echo %refoutput%