Search found 61 matches

by shadeclan
06 Dec 2011 09:21
Forum: DOS Batch Forum
Topic: Speed Writing a File
Replies: 17
Views: 9462

Re: Speed Writing a File

jeb wrote:... It's faster to combine the echo's into one block and redirect only once ...

This hadn't occurred to me - I will try it and see if it speeds things up.
by shadeclan
06 Dec 2011 07:46
Forum: DOS Batch Forum
Topic: Speed Writing a File
Replies: 17
Views: 9462

Speed Writing a File

Is there a faster (batch) way to write to a file besides the echo command? I could create an object in VBScript that accesses the scripting.FileSystemObject but I was wondering if there was a pure DOS method? The object of this question is to rewrite a larger file while leaving some lines out and e...
by shadeclan
02 Dec 2011 08:25
Forum: DOS Batch Forum
Topic: Reverse Parsing
Replies: 10
Views: 6723

Re: Reverse Parsing

... This is the solution for DOS as well ... Interesting solution - I will need to file this in my notes in case I need to reverse the order of lines in a file - but it's still less efficient in this application where the goal is to read a few lines at the end of a large file without going through ...
by shadeclan
01 Dec 2011 18:32
Forum: DOS Batch Forum
Topic: Sorted Delete of Files in a Directory
Replies: 1
Views: 1840

Re: Sorted Delete of Files in a Directory

Herp Derp! :oops: What a moron I am! I could have used sort /r and skipped the first counting loop entirely!
by shadeclan
01 Dec 2011 14:03
Forum: DOS Batch Forum
Topic: Sorted Delete of Files in a Directory
Replies: 1
Views: 1840

Sorted Delete of Files in a Directory

Please forgive my exuberance - I've just never done anything like this before and I wanted to share! I created an batch file that builds and executes FTP scripts every week for a special case where I needed to transfer a file from one FTP server to another through an intermediary that had security a...
by shadeclan
17 Nov 2011 07:51
Forum: DOS Batch Forum
Topic: Reverse Parsing
Replies: 10
Views: 6723

Re: Reverse Parsing

OJBakker wrote:If you enumerate the file with leading zeroes the reverse ordering can be done with Sort /R
That's an interesting idea but I think it will eat up more processor time and memory than my work-around.
by shadeclan
17 Nov 2011 07:44
Forum: DOS Batch Forum
Topic: Reverse Parsing
Replies: 10
Views: 6723

Re: Reverse Parsing

In DOS that is not possible ( in assembly it is ), it is also not logical. Good morning, Mr. Spock. I'm not sure why you'd say that, Ed. After all, in the often-used phrase: @echo.some text>> SomeLogFile.txt DOS must know where the end of the file in order to append the line to it. I have a running...
by shadeclan
16 Nov 2011 14:23
Forum: DOS Batch Forum
Topic: Reverse Parsing
Replies: 10
Views: 6723

Reverse Parsing

I'm just full of questions today!

Is it possible to parse a file starting at the end instead of the beginning, similar to using a negative number when iterating a range of values in a FOR loop?

Hi, Ed! :D
by shadeclan
16 Nov 2011 13:16
Forum: DOS Batch Forum
Topic: FTP !
Replies: 0
Views: 4120

FTP !

Has anybody used the ! command with FTP? I'm having some syntax issues. Basically, I want to temporarily leave the FTP prompt and check if files have been downloaded. If so, I want to exit and return to the FTP prompt but, if not, I want to quit the FTP prompt. Anybody have any examples of code whic...
by shadeclan
16 Nov 2011 10:24
Forum: DOS Batch Forum
Topic: FTP LCD Failure
Replies: 0
Views: 3934

FTP LCD Failure

I'm having a problem with the LCD command. No matter how I phrase the command, even when it says that it accepts it, it still thinks it's in the default directory. I've tried: lcd C:\Documents and Settings\[MyProfile]\New Folder\Backup lcd "C:\Documents and Settings\[MyProfile]\New Folder\Backu...
by shadeclan
03 Nov 2011 10:03
Forum: DOS Batch Forum
Topic: Full Path in For Loop
Replies: 10
Views: 3639

Re: Full Path in For Loop

alan_b wrote:Actually you get a ton of documentation by typing

Code: Select all

FOR /?


Most DOS commands give help via /?
Namaste!

I actually have a link to DOS commands in my Windows XP help file. The explanation tends to be a little bit more thorough than the help parameter.
by shadeclan
03 Nov 2011 06:50
Forum: DOS Batch Forum
Topic: Full Path in For Loop
Replies: 10
Views: 3639

Re: Full Path in For Loop

Actually FIND does not care about USEBACKQ - It is the FOR /F syntax that changes with the USEBACKQ option: for /f %%A in (file1 file2...) --> for /f "usebackq" %%A in ("file1" "file2"...) for /f %%A in ("string") --> for /f "usebackq" %%A in ('stri...
by shadeclan
02 Nov 2011 13:25
Forum: DOS Batch Forum
Topic: Full Path in For Loop
Replies: 10
Views: 3639

Re: Full Path in For Loop

Got It! Twas a combination of PEBKAC error and the fact that the FIND function doesn't like USEBACKQ.

Sorry. :oops:
by shadeclan
02 Nov 2011 13:01
Forum: DOS Batch Forum
Topic: Full Path in For Loop
Replies: 10
Views: 3639

Re: Full Path in For Loop

Here's a related question. I need to use a FIND statement in a FOR loop. I'm having the same problem - the loop is blowing up. Even with the usebackq option, it still blows up. Just for giggles, I tried pasting the path into the FIND statement and escaping the spaces - no luck. for /f "usebackq...
by shadeclan
02 Nov 2011 07:56
Forum: DOS Batch Forum
Topic: Full Path in For Loop
Replies: 10
Views: 3639

Re: Full Path in For Loop

dbenham wrote:Look at my edited response above as well - you can escape problem characters like <space>

Dave Benham
Thanks for the info - I'll tuck that away for later use. In real life, I'm passing a full path back from a custom DOS function I created, so escaping spaces would prove difficult.