Search found 397 matches

by miskox
17 Apr 2012 02:38
Forum: DOS Batch Forum
Topic: Exit FOR loop prematurely?
Replies: 7
Views: 7036

Re: Exit FOR loop prematurely?

Ok, I did some testing. Here are my results: First we have a file a.a: Record_01 Record_02 Record_03 Record_04 Record_05 Record_06 Record_07 Record_08 Record_09 Record_10 Record_11 Record_12 Record_13 Record_14 Record_15 Record_16 Record_17 Record_18 Record_19 Record_20 Record_21 Record_22 Record_23...
by miskox
16 Apr 2012 11:49
Forum: DOS Batch Forum
Topic: Running a DOS command with options when I reboot the system
Replies: 14
Views: 6471

Re: Running a DOS command with options when I reboot the sys

- start -> run -> gpedit.msc - Under computer configuration -> windows settings -> scripts -> right click on shutdown -> select properties -> add the name of the program you want to run (.cmd, .bat, .vbs...). Just try it. I heared once that there might be a time limit on this - you better check this...
by miskox
16 Apr 2012 09:05
Forum: DOS Batch Forum
Topic: HTML file parsing with batch
Replies: 2
Views: 2584

Re: HTML file parsing with batch

sed -r -n "/<[Aa]\s/{s/.*<[Aa]\s//;s/<\/[Aa]>.*//;p}" index.htm I don't have sed installed so please translate this to English . My original post lacks some information: the complete info that *is* between <A and </A is not what I need. It is there but there are some other factors to chec...
by miskox
16 Apr 2012 05:47
Forum: DOS Batch Forum
Topic: Exit FOR loop prematurely?
Replies: 7
Views: 7036

Re: Exit FOR loop prematurely?

Yes, of course. GOTO will do the trick... (means more labels but who cares).

Thanks,
Saso
by miskox
16 Apr 2012 05:46
Forum: DOS Batch Forum
Topic: dynamic variable replacement?
Replies: 2
Views: 1809

Re: dynamic variable replacement?

@foxidrive: Thank you.

I remember I used it once just couldn't find it/remember where it was. Here it is viewtopic.php?p=3899#p3899

Thanks again,
Saso
by miskox
16 Apr 2012 05:25
Forum: DOS Batch Forum
Topic: HTML file parsing with batch
Replies: 2
Views: 2584

HTML file parsing with batch

I did some testing (and with some success) of HTML parsing with batch program. An idea was to first dump (based on this http://www.dostips.com/forum/viewtopic.php?p=14361#p14361 and this http://www.dostips.com/forum/viewtopic.php?p=14704#p14704) the html file and then read byte by byte and do whatev...
by miskox
16 Apr 2012 05:15
Forum: DOS Batch Forum
Topic: dynamic variable replacement?
Replies: 2
Views: 1809

dynamic variable replacement?

Ok, title is probably not what it should be - I will change it if I remember anything else. I have this problem: @echo off set /a counter=0 set var2=sometextetc :0 set var1=%var2:~%counter%,1% set /a counter=counter + 1 echo %var1% if %counter% leq 10 goto :0 REM above we make sure string length is ...
by miskox
16 Apr 2012 05:08
Forum: DOS Batch Forum
Topic: Exit FOR loop prematurely?
Replies: 7
Views: 7036

Exit FOR loop prematurely?

Hi all, is it possible to exit FOR loop prematurely? Some info: Let's say I have a file abc.txt with 100 records. I do this: for /f "tokens=1 skip=10 delims=" %%i in (abc.txt) do call :DOSOMETHING %%i :0 echo Continue here... for /f "tokens=1 skip=30 delims=" %%i in (abc.txt) do ...
by miskox
13 Apr 2012 02:40
Forum: DOS Batch Forum
Topic: Unzip or Unrar files with Batch file?
Replies: 21
Views: 20007

Re: Unzip or Unrar files with Batch file?

There is a FREE official unRAR console application for Win 32: m I am sure it can handle wildcard characters (I don't use it). As mentioned here http://www.dostips.com/forum/viewtopic.php?p=14704#p14704 I use unzip.exe (size of 159744 bytes). I created three .zip files and if I use unzip *.zip they ...
by miskox
11 Apr 2012 12:57
Forum: DOS Batch Forum
Topic: Binary converter
Replies: 10
Views: 11341

Re: Binary converter

Looks like Unicode.

Code: Select all

M a p s 2 B g l . e x e   I : \ _ V j i h \ _ E X T R A   


Saso
by miskox
11 Apr 2012 10:28
Forum: DOS Batch Forum
Topic: Binary converter
Replies: 10
Views: 11341

Re: Binary converter

Lines end with LineFeed (LF). Windows (and DOS) use CarriageReturn+LineFeed (CRLF). Looks like this file has Unix (LF only) format. But I found this file in here too (with correct CRLF):
I use GSAR for such conversions.

http://www.batchlog.pytalhost.com/Batchfiles.zip

(Check other files, too - there is a Monopoly game in batch).

Saso
by miskox
11 Apr 2012 10:11
Forum: DOS Batch Forum
Topic: Need to add a space between filename and date
Replies: 3
Views: 2148

Re: Need to add a space between filename and date

I would suggest you rename files to:

Code: Select all

YYYY-MM-DD test1.txt


or

Code: Select all

test1 YYYY-MM-DD


(It is easier to sort files).

Saso
by miskox
11 Apr 2012 10:06
Forum: DOS Batch Forum
Topic: Binary converter
Replies: 10
Views: 11341

Re: Binary converter

Looks like you can download the file here: http://www.batchlog.pytalhost.com/Hex2All.bat

Convert LF to CRLF.

Hope this helps,
Saso
by miskox
02 Apr 2012 12:05
Forum: DOS Batch Forum
Topic: A clever way to embed a entir text file within a batch file?
Replies: 10
Views: 9749

Re: A clever way to embed a entir text file within a batch f

Hi all, I am using the following method (this is the reason why I wanted this http://www.dostips.com/forum/viewtopic.php?f=3&t=3089&start=0 . Then I changed aGerman's batch to more 'user friendly'. I just couldn't make his version output a fixed length output. But his approach is that what I...
by miskox
26 Mar 2012 09:10
Forum: DOS Batch Forum
Topic: Clear typeahead buffer in DOS
Replies: 3
Views: 2441

Clear typeahead buffer in DOS

Hi all, I was wondering if this is possible to achieve in DOS. ZX Spectrum code: 10 IF INKEY$ <>"" THEN GO TO 10 20 IF INKEY$ ="" THEN GO TO 20 OpenVMS DCL code: $ set term/notypeahead I was doing some repeating tasks. After a specific tasks completed I used a set/p to wait for E...