Search found 475 matches

by SIMMS7400
14 Sep 2020 04:18
Forum: DOS Batch Forum
Topic: File/Folder Purging - Best practice?
Replies: 0
Views: 120

File/Folder Purging - Best practice?

Hi Folks - I'm trying to developing a purging process but I haven't been able to land on anything that I really like yet so wanted to get your opinion. What is the best way to go about this? Can I merely just use a forfiles to remove an entire directory based on AGE, or should I remove files first a...
by SIMMS7400
10 Aug 2020 18:01
Forum: DOS Batch Forum
Topic: Performance Issues with Code
Replies: 22
Views: 1396

Re: Performance Issues with Code

Here are the results: Atonio's Solution Start Time : 19:54:44.36 End Time : 19:56:33.82 Shadow's Solution Start Time : 19:57:22.91 End Time : 19:58:54.68 File Size : 797761 lines I stand corrected, Shadow's solution is quicker! My apologies for the incorrect message earlier, I was trying to time thi...
by SIMMS7400
10 Aug 2020 17:35
Forum: DOS Batch Forum
Topic: Performance Issues with Code
Replies: 22
Views: 1396

Re: Performance Issues with Code

Hello Gents -

With a file of about 700k lines, Antonio's solution is about 30 seconds faster. Pretty significant difference, but both are still unbelieveavly quick.

Thank you again to you both for these solutions!!
by SIMMS7400
10 Aug 2020 04:13
Forum: DOS Batch Forum
Topic: Purge Function - best way?
Replies: 1
Views: 447

Purge Function - best way?

Hi Folks - One can read for hours and hours online about the best way to purge files and folders (and sub directories). Everyone seems to have their own iteration. This is what I came up with. Essentially, a path (less the trailing "\" is passed to a function and then I run a FORFILES over it to rem...
by SIMMS7400
10 Aug 2020 04:10
Forum: DOS Batch Forum
Topic: Performance Issues with Code
Replies: 22
Views: 1396

Re: Performance Issues with Code

WOW! I'm going to play around with these solutions and see what works best.

It looks like Shadow's and Atonio's solution are comparable? I forgot how fast Shadow's code ran so i will need to do some runs times...
by SIMMS7400
04 Aug 2020 12:45
Forum: DOS Batch Forum
Topic: Performance Issues with Code
Replies: 22
Views: 1396

Re: Performance Issues with Code

Hi both -

I do need token 1 as I do want to extract the year, but this runs is such quick time anymore, keeping that in make little difference.

Absolutely incredible performance gains on this, thank you Shadow!!! Very much appreciated!
by SIMMS7400
04 Aug 2020 12:03
Forum: DOS Batch Forum
Topic: Performance Issues with Code
Replies: 22
Views: 1396

Re: Performance Issues with Code

Shadow -

Awesome, that's exactly what I did and it's working great. Thank you! Just for my own curiosity, what's the advantage of the SET /A logic vs the previous way of just listing out the different arrays other than a smaller block of code? Any performance increases?
by SIMMS7400
04 Aug 2020 10:13
Forum: DOS Batch Forum
Topic: Performance Issues with Code
Replies: 22
Views: 1396

Re: Performance Issues with Code

Shadow - Holy Shit** - this is an incredible performance increase!!! It just took a process from ~2 hours down to 8 seconds, wow! Thank you! One thing is, I copied your code before you made your second edit, adding the SET /A logic. Prior to your edit, "Jan" in the file was returning as "01" which i...
by SIMMS7400
04 Aug 2020 07:41
Forum: DOS Batch Forum
Topic: Performance Issues with Code
Replies: 22
Views: 1396

Performance Issues with Code

Hi Folks - A few months back, Atonio helped me with a chunk of code that determined "min" and "max" month in a data file. I expanded it a bit more to except months in the following formats: 1,01,Jan and January It's working fine. However, performance is not so great. 1600 lines takes a few minutes t...
by SIMMS7400
01 Aug 2020 03:26
Forum: DOS Batch Forum
Topic: Why doesn't this replacement work?
Replies: 3
Views: 944

Re: Why doesn't this replacement work?

Thank you T3RRY and Phil!!

T3RRY's solution is working as expected, but is there one that is preferred between the two? WHat is better and why? Or does it not matter?
by SIMMS7400
01 Aug 2020 03:14
Forum: DOS Batch Forum
Topic: Get line with highest numerical string
Replies: 12
Views: 3280

Re: Get line with highest numerical string

HI Antonio -

That did the trick, thank you so much!!!
by SIMMS7400
31 Jul 2020 03:13
Forum: DOS Batch Forum
Topic: Get line with highest numerical string
Replies: 12
Views: 3280

Re: Get line with highest numerical string

HI Squash - When leveraging your suggestion, it does not yield the correct results. But I need to make the "pbcs" part more generic...It could be any non-numerical string here. THis seems to work with my test, but is it best practice based on my business need? for /F "delims=" %%a in ('findstr "outb...
by SIMMS7400
30 Jul 2020 08:42
Forum: DOS Batch Forum
Topic: Get line with highest numerical string
Replies: 12
Views: 3280

Re: Get line with highest numerical string

THis works: for /F "delims=" %%a in ('findstr "outbox/logs/" test.txt ^|FINDSTR /V ".pbcs.log"') But I need to make the "pbcs" part more generic...It could be any non-numerical string here. THis seems to work with my test, but is it best practice based on my business need? for /F "delims=" %%a in ('...
by SIMMS7400
30 Jul 2020 08:17
Forum: DOS Batch Forum
Topic: Get line with highest numerical string
Replies: 12
Views: 3280

Re: Get line with highest numerical string

HI AAcini - I just wanted to say thank you again for your solution, it's working great! I am running into once issue. There are times when there is another string between the numerical portion and the .log, which I don't want to factor into the logic. Is there a way to ignore those instances? outbox...
by SIMMS7400
11 Jul 2020 09:23
Forum: DOS Batch Forum
Topic: Why doesn't this replacement work?
Replies: 3
Views: 944

Why doesn't this replacement work?

Hi Folks - I have the following script (trimmed down for example purposes): @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION SET X=T PUSHD "D:\TEMP" IF DEFINED X ( SET "SEARCH="Rule Name","File Name:","Error: 3303","Error: 3304","Error: 3333","Error: 3335","Error: 3336","Error: 3337","does not exist for th...