Search found 10 matches

by chcfrank
29 May 2008 20:32
Forum: DOS Batch Forum
Topic: remove a square
Replies: 3
Views: 5352

Re: remove a square

Not sure what you mean by 'square'. Is it a special character look like a square? Your copy command should not append anything extra. Have you check the file size of the result is the sum of the size of the three source files? -Frank Hi All, I'm new to dos batch files and am only using to append fil...
by chcfrank
29 May 2008 20:24
Forum: DOS Batch Forum
Topic: loop works (almost) but I need "nested" output
Replies: 2
Views: 4566

Re: loop works (almost) but I need "nested" output

Davep, Here is my prototype is the command prompt, you should be able to convert it into a script. To print initial spaces, use echo. instead just echo c:\>echo ^<Markers^> & for /f %i in (x.txt) do @(echo. ^Marker & echo. Time="%i" & echo. Value="%i" &...
by chcfrank
29 May 2008 19:49
Forum: DOS Batch Forum
Topic: Any one-liner script to determine leap year?
Replies: 4
Views: 7564

Hi, Jeb, Thanks, I thought ^ is 'bitwise exclusive or'. Never thought about it is escape char. -Frank Hi Frank, the 'set' command supports '&' "bitwise and", "| bitwise or" but the & is also the delimeter for the next command on one line. like set /a var=1 & echo hell...
by chcfrank
26 May 2008 20:45
Forum: DOS Batch Forum
Topic: Any one-liner script to determine leap year?
Replies: 4
Views: 7564

jeb, Thanks! I know it is doable! Again, how do I interpret '^|' and '^&'. I do not seem to find anything reference about these operator(most stuff about DOS scripts I can find by 'set /?', 'for /?', 'if /?', 'call /?', ...) And this equation will fail if I put <space> between ^ and | or ^ and &...
by chcfrank
26 May 2008 10:09
Forum: DOS Batch Forum
Topic: map and lookup - please explain
Replies: 2
Views: 4709

Jeb, Thanks for the detailed explaination. Should I interpret *xx as 'a regular expression to match anything up to xx' rather than 'first occurence of xx'? -Frank %var:*xx=yy% only replaces the first occurence of xx with yy in var, and the results begins with the first occurence (removing of the fro...
by chcfrank
25 May 2008 11:42
Forum: DOS Batch Forum
Topic: Any one-liner script to determine leap year?
Replies: 4
Views: 7564

Any one-liner script to determine leap year?

I can determine whether it is leap year in couple of lines of batch script(witout using &) and most other scripting language support one-liner equation to determine whether it is leap year. But I cannot figure out how to do this in dos batch script since DOS does not support operator like (a == ...
by chcfrank
25 May 2008 09:48
Forum: DOS Batch Forum
Topic: Approach using single script if other lang(VBS) is needed?
Replies: 0
Views: 4602

Approach using single script if other lang(VBS) is needed?

In some case, I want to use other scripting language(like VB script, perl, awk) to perform certain tasks that is hard to implement in DOS batch script. However, I will still need to create a DOS script to wrap around this other script so that I can run the whole thing with single command(I don't wan...
by chcfrank
25 May 2008 09:22
Forum: DOS Batch Forum
Topic: Can I calculate a date?
Replies: 8
Views: 12786

Any other way without using jdate/jdate2date ?

What I want to do is to return the date 30(or any number but usually less than 90) days from today(or any specified date string like 03/07/2008). I am thinking whether to use VBScript DateAdd function but I would like to use complete DOS Batch command(if the code is simple/short enough) if possible....
by chcfrank
25 May 2008 09:11
Forum: DOS Batch Forum
Topic: Batch script to show day of the year?
Replies: 1
Views: 6895

Batch script to show day of the year?

Any ideas(simpler) to calculate day of the year? What I can come up so far is to: 1. use 'map and lookup' idea by creating a string which maps the month to total number of days in previous month like: set days=01-00;02-31;03-59;04-90 ... 2. add the resulting value from month to the day value 3. adju...
by chcfrank
25 May 2008 08:12
Forum: DOS Batch Forum
Topic: map and lookup - please explain
Replies: 2
Views: 4709

map and lookup - please explain

Can someone explain the example on the 'map and lookup' tips under the 'String manipulation'? m REM ---- Example 2: Translate abbreviation into full string ---- SET v=sun set map=mon-Monday;tue-Tuesday;wed-Wednesday;thu-Thursday;fri-Friday;sat-Saturday;sun-Sunday CALL SET v=%%map:*%v%-=%% SET v=%v:;...