Search found 4021 matches

by Squashman
10 Jan 2012 10:23
Forum: DOS Batch Forum
Topic: Determining the number of lines in a file.
Replies: 50
Views: 19601

Re: Determining the number of lines in a file.

Thanks Ed. That worked. Didn't realize I needed to assign that variable to another variable before the ENDLOCAL. Delayed Expansion was enabled higher up in the script.
by Squashman
10 Jan 2012 10:07
Forum: DOS Batch Forum
Topic: Game help,if player has money smaller than cost of something
Replies: 4
Views: 2019

Re: Game help,if player has money smaller than cost of somet

Does your MONEY variable have a currency symbol in it or not? If it does you need to remove it from the variable in order to compare the two values. I am no math major but I am pretty sure 50 is not the same as 500. IF %Money% LSS 50 Echo You dont have enough money to buy this item. And IF this stat...
by Squashman
09 Jan 2012 18:09
Forum: DOS Batch Forum
Topic: Determining the number of lines in a file.
Replies: 50
Views: 19601

Re: Determining the number of lines in a file.

I was thinking about making this post a separate thread but since it is going to be integrated into this one script I am just going to post it here. As I said in my last post I am going to use Judago's Divide.bat to calculate the number of lines because we may run into file sizes that are larger tha...
by Squashman
09 Jan 2012 14:47
Forum: DOS Batch Forum
Topic: schtasks - checking for shutdown.exe and overwrite
Replies: 15
Views: 8490

Re: schtasks - checking for shutdown.exe and overwrite

I believe this would work.

Code: Select all

for /f "skip=1 tokens=2 delims=," %%F in ('schtasks /query /v /FO CSV ^|findstr "shutdown.exe"') do schtasks /delete /TN %%F
by Squashman
09 Jan 2012 14:34
Forum: DOS Batch Forum
Topic: schtasks - checking for shutdown.exe and overwrite
Replies: 15
Views: 8490

Re: schtasks - checking for shutdown.exe and overwrite

Use the Query option and pipe it to the findstr command.

schtasks /query /V /FO CSV | findstr "shutdown.exe"

Can probably put that into a for loop to get the correct token as well.
by Squashman
08 Jan 2012 13:46
Forum: DOS Batch Forum
Topic: 2 pushd one for temp and one for location where file is
Replies: 4
Views: 1960

Re: 2 pushd one for temp and one for location where file is

What do you mean you won't know. You just echoed the output to whatever directory is assigned to the temp variable because you did the pushd first so use the temp variable with the set statement. Set /p nick=<%temp%\nick.db Word of advice to you. Make sure you close up the spaces when you are using ...
by Squashman
08 Jan 2012 13:03
Forum: DOS Batch Forum
Topic: 2 pushd one for temp and one for location where file is
Replies: 4
Views: 1960

Re: 2 pushd one for temp and one for location where file is

you know you can use the full path to the filename.
by Squashman
08 Jan 2012 11:57
Forum: DOS Batch Forum
Topic: Specify which line to read in "Findstr"
Replies: 4
Views: 4705

Re: Specify which line to read in "Findstr"

It might actually help if you could post an example of your input and what you expect the output to be.
by Squashman
06 Jan 2012 17:03
Forum: DOS Batch Forum
Topic: Determining the number of lines in a file.
Replies: 50
Views: 19601

Re: Determining the number of lines in a file.

Wow Dave, you really outdid yourself. That is like instantaneous output on a 1.2GB file. Now I just need to Divide the Line Length into the File size and that should give the total lines. I would have never thought of using FC and FINDSTR that way. In fact I just used FC for the first time just a fe...
by Squashman
06 Jan 2012 10:31
Forum: DOS Batch Forum
Topic: Drawing rudimentary graphics in text mode
Replies: 46
Views: 28298

Re: Drawing rudimentary graphics in text mode

This is some cool stuff. Didn't realize you could change the color like that. I always assumed it was an all or nothing.
by Squashman
06 Jan 2012 06:04
Forum: DOS Batch Forum
Topic: Determining the number of lines in a file.
Replies: 50
Views: 19601

Re: Determining the number of lines in a file.

Dave I do see your point though on the last line not having an EOL. My math will not work if that happens.
by Squashman
06 Jan 2012 05:47
Forum: DOS Batch Forum
Topic: Determining the number of lines in a file.
Replies: 50
Views: 19601

Re: Determining the number of lines in a file.

Hi Alan, Thanks for your input but I got that covered as well. A missing EOL on the last line does not affect a ftp upload to our mainframe. No big deal at all. Now I can say that in 15 years of working in this job I have not seen mixed EOL but I have already seen it talked about on this forum. That...
by Squashman
05 Jan 2012 15:04
Forum: DOS Batch Forum
Topic: Determining the number of lines in a file.
Replies: 50
Views: 19601

Re: Determining the number of lines in a file.

I haven't ran into a file yet that this hasn't worked on. The Majority of time our clients send in clean fixed length data so it should work.
I should put in a check when doing the modulus for the EOF check. If it is Greater than 1 then we know there is something wrong with the file.
by Squashman
05 Jan 2012 11:29
Forum: DOS Batch Forum
Topic: Problem with set /A
Replies: 4
Views: 2619

Re: Problem with set /A

Missing a Carrot before the first pipe.