Search found 443 matches

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: 103757

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: 748

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: 1755

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: 1755

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: 2685

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: 2685

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: 2685

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?
by SIMMS7400
09 Aug 2019 06:26
Forum: DOS Batch Forum
Topic: SORT Order not working correction
Replies: 8
Views: 2685

SORT Order not working correction

HI Folks - For some reason, the SORT function is not working as I would expect. I am sorting the 5th column which has values from 1 through 12. However, when I do SORT /R it's saying the max is9, not 12. Here is my code: ( FOR %%F IN ("!DATAFILENAME!") DO ( REM Sort PERIOD Column in reverse order to...
by SIMMS7400
19 Jul 2019 07:55
Forum: DOS Batch Forum
Topic: Display folder contents to user and allow them to pick
Replies: 4
Views: 2151

Re: Display folder contents to user and allow them to pick

If i understand your code and task right, then just add that echo before the pause command (and put an goto :eof behind pause to not falsely entering the :process part of your batch). echo(Your choice is: !$_%SELECTION%! pause goto :eof penpen Hi PenPen - That worked perfectly, thank you! I do have...
by SIMMS7400
17 Jul 2019 10:33
Forum: DOS Batch Forum
Topic: Display folder contents to user and allow them to pick
Replies: 4
Views: 2151

Re: Display folder contents to user and allow them to pick

In doing some research, I came up with this approach which get's me 90% there: :SELECT_BACKUP SET "DOTS=..." FOR %%A IN ("Daily" "Weekly" "Monthly" "Yearly") DO ( FOR /F "delims=" %%a IN ('DIR /S /B "%BACKUPPATH%%%A"') DO ( CALL :PROCESS "%%~a" ) ) :REPEAT CLS FOR /l %%A IN (1,1,%ZIP%) DO ( IF %%A l...
by SIMMS7400
17 Jul 2019 10:03
Forum: DOS Batch Forum
Topic: Display folder contents to user and allow them to pick
Replies: 4
Views: 2151

Display folder contents to user and allow them to pick

Hi Folks - I have a need to create a script that will display the folder contents from (4) different data backup folders I have. At most, there would only be 44 data files to choose from. I want the script to essentially cycle through each backup folder and display the content (with data modified) b...
by SIMMS7400
17 Jul 2019 04:15
Forum: DOS Batch Forum
Topic: Strange Issue with FOR LOOP; ignoring last record?
Replies: 3
Views: 1725

Re: Strange Issue with FOR LOOP; ignoring last record?

To correct for now, I added a second sort with SORT /R.
by SIMMS7400
17 Jul 2019 04:00
Forum: DOS Batch Forum
Topic: Strange Issue with FOR LOOP; ignoring last record?
Replies: 3
Views: 1725

Strange Issue with FOR LOOP; ignoring last record?

HI Folks - I have the following script created to output unique values from a list. Prior to this step, I sort a single columntext file extracted from a data-dump from one of my data bases. From here, I need to pull out any unique records. The issue is when the uniq record is the LAST record, for so...
by SIMMS7400
14 Jun 2019 02:15
Forum: DOS Batch Forum
Topic: Determine lowest & highest number from column
Replies: 1
Views: 1399

Re: Determine lowest & highest number from column

I arrived at this solution, although I'm not sure if it's as efficient as it can be: @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION ( FOR %%F IN ("*.csv") DO ( REM Sort PERIOD Column in reverse order to get MAX value SET "MAX=" SET "MIN=" FOR /F "tokens=2,3 delims=," %%A IN ('SORT /R "%%F"') DO ( IF NOT ...