Search found 451 matches

by SIMMS7400
22 Mar 2020 03:11
Forum: DOS Batch Forum
Topic: Get line with highest numerical string
Replies: 6
Views: 379

Re: Get line with highest numerical string

Thank you, all!!

I reallly Aacini's and Dave's solutions and I am going to leverage both. The file to scan will only be about 200 lines max, give or take a few.

Thank you again and I hope everyone is healthy!
by SIMMS7400
13 Mar 2020 01:49
Forum: DOS Batch Forum
Topic: Get line with highest numerical string
Replies: 6
Views: 379

Re: Get line with highest numerical string

Thank you Hackadoo.

Unfortunately, I don't think it's fail proof. if I add this line to the file:
outbox/logs/DIM_BPMC_PLN - Account_2082.log
It doesn't return it. Furthermore, if I add "7898574" to a file name, it doesn't pull that either.
outbox/logs/DIM_BPMC_PLN - Account_7898574.log
by SIMMS7400
12 Mar 2020 18:50
Forum: DOS Batch Forum
Topic: Get line with highest numerical string
Replies: 6
Views: 379

Get line with highest numerical string

Hello Folks - I have a output file that I need to parse. The output file consists of this: outbox/logs/DIM_BPMC_PLN - Account_292.log outbox/logs/DIM_BPMC_PLN - Account_287.log outbox/logs/DIM_BPMC_PLN - Account_285.log outbox/logs/DIM_BPMC_PLN - Account_284.log outbox/logs/Account Reconciliation Ma...
by SIMMS7400
20 Feb 2020 11:28
Forum: DOS Batch Forum
Topic: Easy way to check tokens 5-16 and delete if specified pattern?
Replies: 4
Views: 2061

Re: Easy way to check tokens 5-16 and delete if specified pattern?

wow!!!! THat was easy enough.

Thank you Dave, I really appreciate it!!!
by SIMMS7400
20 Feb 2020 03:22
Forum: DOS Batch Forum
Topic: Easy way to check tokens 5-16 and delete if specified pattern?
Replies: 4
Views: 2061

Easy way to check tokens 5-16 and delete if specified pattern?

Hi Folks - I have the following data file (sample) that is created by another team and they are unwilling to work with me to clean up their process. Therefore, I need to handle cleaning up the file on my end: E01,S00000,1040-00,2019,"","","","","","","","","","","","" E01,S00000,1100-00,2019,267171....
by SIMMS7400
14 Oct 2019 05:48
Forum: DOS Batch Forum
Topic: How to work with CSV containing many columns
Replies: 3
Views: 7152

Re: How to work with CSV containing many columns

Dave - I ended up with VBS. What I tried to do is spool all the strings greater than 300 to a temp file and then use JSCRIPT to do a find and replace on the original file, however that was taking a very long time to complete. The file is 105 columns X 47k rows. strTrimFile = "Trim_List_" & Year(Date...
by SIMMS7400
12 Oct 2019 06:42
Forum: DOS Batch Forum
Topic: How to work with CSV containing many columns
Replies: 3
Views: 7152

Re: How to work with CSV containing many columns

HI Dave - Thanks for this! I'm trying to incorporate the parseCSV with the macro for more than 32 columns on this link: https://www.dostips.com/forum/viewtopic.php?f=3&t=5702&p=59742#p59742 For some reason, it doesn't return anything. Also, is there a way to check a column in X position and if the v...
by SIMMS7400
10 Oct 2019 18:56
Forum: DOS Batch Forum
Topic: How to work with CSV containing many columns
Replies: 3
Views: 7152

How to work with CSV containing many columns

Hi Folks - I wrote a piece of code to check for string lengths over 300 and trim back down to 300. ::-- Set maximum length of string --:: SET "STRINGLEN=300" SET "TOT_COLS=6" IF EXIST "datafiletemp.csv" DEL /F /Q "datafiletemp.csv" >nul 2>&1 FOR /F "USEBACKQ tokens=1-%TOT_COLS% delims=," %%A IN ( "d...
by SIMMS7400
26 Aug 2019 18:29
Forum: DOS Batch Forum
Topic: FindRepl.bat:New regex utility to search and replace strings
Replies: 139
Views: 121469

Re: FindRepl.bat:New regex utility to search and replace strings

HI There -

I'm trying to use this script and it works fine on my local machine. But when I promote to my server, I'm getting permission denied on line 318 of FINDREPL. ANy ideas why? I have write access to the directory.
by SIMMS7400
22 Aug 2019 03:05
Forum: DOS Batch Forum
Topic: .Bat File calling with other .bat file with paramater isue
Replies: 2
Views: 2261

Re: .Bat File calling with other .bat file with paramater isue

I see you copied in the string length function wrong. Review your other thread and try again. You're missing an entire parameter.
by SIMMS7400
20 Aug 2019 03:51
Forum: DOS Batch Forum
Topic: How to validate digit number from .txt file
Replies: 8
Views: 4220

Re: How to validate digit number from .txt file

How about you try yourself using one of the many examples already provided to you?
by SIMMS7400
18 Aug 2019 03:43
Forum: DOS Batch Forum
Topic: How to validate digit number from .txt file
Replies: 8
Views: 4220

Re: How to validate digit number from .txt file

This works, let us know if this meets your need. @echo off setlocal enableExtensions disableDelayedExpansion for /f "skip=1 tokens=1 delims=, " %%a in ('findstr /v /r /c:"^[0-9, ]*," "test.csv"') do ( setlocal enabledelayedexpansion SET "string=%%~a" & CALL :STRLEN result string if "!result!" GTR "6...
by SIMMS7400
12 Aug 2019 17:53
Forum: DOS Batch Forum
Topic: SORT Order not working correction
Replies: 8
Views: 5731

Re: SORT Order not working correction

Are you using SORT not for sorting, but to get maximum and minimum? And two times ? :shock: Strange thing... Why not keep things simple? Try: @echo off setlocal set /A max=-99999, min=99999 for /F "usebackq tokens=5,6 delims=|" %%a in ("%%~F") do ( if %%a gtr !max! set "max=%%a" if %%a lss !min! se...
by SIMMS7400
09 Aug 2019 18:22
Forum: DOS Batch Forum
Topic: SORT Order not working correction
Replies: 8
Views: 5731

Re: SORT Order not working correction

Thank you! Let me play around with this and see if I can get it to work. Ultimately, I need MIN and MAX, I can adjust and see what it renders.

Thanks!
by SIMMS7400
09 Aug 2019 09:42
Forum: DOS Batch Forum
Topic: SORT Order not working correction
Replies: 8
Views: 5731

Re: SORT Order not working correction

HI Antonio -


Hmmm - I see and now understand. What would be my path forward to overcome this hurdle? I tried to strip out just that column but no luck. Can this still even be done?