Search found 446 matches

by SIMMS7400
14 Oct 2019 05:48
Forum: DOS Batch Forum
Topic: How to work with CSV containing many columns
Replies: 3
Views: 1650

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

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

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

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

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

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

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

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

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

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

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

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

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

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...