Search found 61 matches
- 20 May 2013 06:37
- Forum: DOS Batch Forum
- Topic: Formatting a File
- Replies: 5
- Views: 5987
Re: Formatting a File
Batch is interpreted line by line by cmd.EXE, batch is slow. Using external executables is always faster, they run from memory and don't need to be translated to machinecode. You could opt for another language like vbScript, that should be about 200 times faster here. Wonder if this is a little fas...
- 20 May 2013 06:31
- Forum: DOS Batch Forum
- Topic: Formatting a File
- Replies: 5
- Views: 5987
Re: Formatting a File
3rd party applications are OK if they are free, portable and reliable, so REGEXP apps like GREP are out. That confuses me as grep is free portable and reliable. I didn't want to add the grep dependencies to our server. I have a hard enough time convincing my boss to let me use stuff I find on the i...
- 17 May 2013 08:25
- Forum: DOS Batch Forum
- Topic: Formatting a File
- Replies: 5
- Views: 5987
Formatting a File
Suppose you have a rather large text file and you need to format each line for consumption by another application. You could do a FOR loop through the file, arrange the data and ECHO it out to a text file simply enough ... for /f "tokens=1-14,* delims=:. " %%a in (%cDataFileTmp%) do ( @ech...
- 02 Apr 2013 10:44
- Forum: DOS Batch Forum
- Topic: Batch Functions: goto:eof, exit /b and structure.
- Replies: 29
- Views: 54861
Re: Batch Functions: goto:eof, exit /b and structure.
Squashman wrote:shadeclan wrote:DOS is a very old language so it lends itself to very old threads ...
DOS is an old operating system. DISK OPERATING SYSTEM. What you mean is batch is old but in reality as far as scripting languages and shells go it is not even as old as CSH or TCSH or Korn for that matter.
It's old to me!
- 02 Apr 2013 09:40
- Forum: DOS Batch Forum
- Topic: Batch Functions: goto:eof, exit /b and structure.
- Replies: 29
- Views: 54861
Re: Batch Functions: goto:eof, exit /b and structure.
I know this is a very old thread; however, I couldn't resist the temptation to insert a couple comments here. Many, many years ago, when I was hired for the first time as computer programmer, my boss was worried about a critical section of a program that must generate a very important result. The k...
- 02 Apr 2013 08:38
- Forum: DOS Batch Forum
- Topic: Batch Functions: goto:eof, exit /b and structure.
- Replies: 29
- Views: 54861
Re: Batch Functions: goto:eof, exit /b and structure.
prasad.gujar wrote:Thanks for the post mate, this info solved a critical fault in my script.
Was it one of my scripts or something that Ed said?
In any case, you're welcome.
- 30 Jan 2012 11:26
- Forum: DOS Batch Forum
- Topic: goto:eof and endlocal
- Replies: 2
- Views: 4206
Re: goto:eof and endlocal
Excellent! Thanks!
- 30 Jan 2012 10:23
- Forum: DOS Batch Forum
- Topic: goto:eof and endlocal
- Replies: 2
- Views: 4206
goto:eof and endlocal
Quick question - does goto:eof do an implicit endlocal? It appears to do so. I was just looking at some of my code and wondering if I had to call endlocal before the goto:eof.
- 12 Dec 2011 07:53
- Forum: DOS Batch Forum
- Topic: Speed Writing a File
- Replies: 17
- Views: 21056
Re: Speed Writing a File
Haha hold on, you misread what I said Yeah, I do that a lot. I suppose that removal of the comments would tend to speed up the processing of long scripts - even double-colon comments which I understand are completely ignored by the interpreter. Double-colon comments don't work inside IF statements ...
- 09 Dec 2011 11:26
- Forum: DOS Batch Forum
- Topic: Speed Writing a File
- Replies: 17
- Views: 21056
Re: Speed Writing a File
' I don't believe in intellectual property rights. What do u mean, you don't have any The Forum: By submitting information to the forum you transfer the rights of its content to the domain owner. The domain owner reserve the right to add, modify, or remove information to/from the forum as the domai...
- 09 Dec 2011 07:53
- Forum: DOS Batch Forum
- Topic: Speed Writing a File
- Replies: 17
- Views: 21056
Re: Speed Writing a File
Good. Commenting is good practice too. However I personally would use that as source, and have a working copy that's stripped and minified. No need on such a short script though. Well, it may not be needful for you but I have a mind like a steel sieve and considering that I am programming in DOS Ba...
- 07 Dec 2011 13:33
- Forum: DOS Batch Forum
- Topic: Speed Writing a File
- Replies: 17
- Views: 21056
Re: Speed Writing a File
Here is my final solution, heavily commented for us know-nothings: :: Generate name of temporary data file. set vDatFile="%vAppDir%DTF_FTP_%random%.dat" :: Generate name of temporary working file. set vTmpFile="%vAppDir%DTF_FTP_%random%.tmp" :: Generate name / location of log fil...
- 06 Dec 2011 14:41
- Forum: DOS Batch Forum
- Topic: Speed Writing a File
- Replies: 17
- Views: 21056
Re: Speed Writing a File
Wow - that was like, amazing! You're explanation was a little verbose but a little playing around with it resolved the problem completely! Thank you so very much!!k wrote:more/? wrote:+n : Start displaying the first file at line n
more +10 will start display that batch at line №10
- 06 Dec 2011 11:33
- Forum: DOS Batch Forum
- Topic: Speed Writing a File
- Replies: 17
- Views: 21056
Re: Speed Writing a File
I did. It displays one screen of output at a time. I'm not sure how that helps me write a file faster. Sorry - I'm stupid, OK? I don't get it.!k wrote:read more/?
- 06 Dec 2011 11:17
- Forum: DOS Batch Forum
- Topic: Speed Writing a File
- Replies: 17
- Views: 21056
Re: Speed Writing a File
@echo off >myFile.txt more +10 %0 for /f %%z in ("myFile.txt") do if not "%%~zz"=="23" (echo:Wrong myFile.txt!&pause&exit) :: Your code is here :: Your code is here goto :eof :: 10th line of batch Line1 Line2 Line4 !k - sorry, but I don't understand this, nor d...