Search found 539 matches

by SIMMS7400
10 Feb 2021 13:43
Forum: DOS Batch Forum
Topic: JREPL Usage - read text file with commas and replace empty value
Replies: 12
Views: 10272

Re: JREPL Usage - read text file with commas and replace empty value

Hi Dave - I just tried the suggestion but unfortunately doesn't seem to work. Here are the contents of my first column, could the comma be causing an issue? CALL "%UTILPATH%Batch\JREPL" "^((?:[^|]*\|){17})\s*(?=$|\|)" "$1Projected Start Date Missing" /A /exc "1,'(USE FOR TERM)|'b" /f "%FDMEE_BIN%%DA...
by SIMMS7400
10 Feb 2021 11:49
Forum: DOS Batch Forum
Topic: JREPL Usage - read text file with commas and replace empty value
Replies: 12
Views: 10272

Re: JREPL Usage - read text file with commas and replace empty value

HI Dave - I'm hoping this would be an easy tweak but there is a new business need. Per the above JREPL solution you suggested, it's working like a charm!! I do need to add a piece of logic that ignore certain rows that contain a specific string, is that possible? If the first column contains a strin...
by SIMMS7400
02 Feb 2021 03:49
Forum: DOS Batch Forum
Topic: Best way to setup a "Dictionary" similar to VBA?
Replies: 16
Views: 11203

Re: Best way to setup a "Dictionary" similar to VBA?

Thanks, A. It was a new development or else I would have revealed in the beginning

Thanks for your time, this is fantastic!!

One last question, how do I get this value into a variable?

Code: Select all

call echo Date is : %%DATAFILENAME:~!STR[%DATAFILENAME:~0,2%].DSP!,!STR[%DATAFILENAME:~0,2%].DEP!%%
by SIMMS7400
01 Feb 2021 03:02
Forum: DOS Batch Forum
Topic: Best way to setup a "Dictionary" similar to VBA?
Replies: 16
Views: 11203

Re: Best way to setup a "Dictionary" similar to VBA?

HI Antonio - Thank you for that suggest. I really do like how you're setting the array definition, nice and clean. One thing I'm running into is that I do have situation where there are multiple Entities which are comma delimited. How would I include them? Do I include them with another delimters an...
by SIMMS7400
30 Jan 2021 03:43
Forum: DOS Batch Forum
Topic: Best way to setup a "Dictionary" similar to VBA?
Replies: 16
Views: 11203

Re: Best way to setup a "Dictionary" similar to VBA?

Historically, I've done something like @echo off setlocal EnableDelayedExpansion rem Define the set of applications set "app[AA].target_application=Application1" set "app[AA].target_entity=Entity1" set "app[BB].target_application=Application2" set "app[BB].target_entity=Entity2" set /P "dataFile=En...
by SIMMS7400
29 Jan 2021 19:10
Forum: DOS Batch Forum
Topic: Best way to setup a "Dictionary" similar to VBA?
Replies: 16
Views: 11203

Re: Best way to setup a "Dictionary" similar to VBA?

Simple. Just use an array: @echo off setlocal EnableDelayedExpansion rem Define the set of applications set "app[AA]=Application1" set "app[BB]=Application2" set /P "dataFile=Enter data file: " echo The application is: !app[%dataFile:~0,2%]! Antonio Thank you Antonio! This is great, didn't realize ...
by SIMMS7400
29 Jan 2021 11:36
Forum: DOS Batch Forum
Topic: Best way to setup a "Dictionary" similar to VBA?
Replies: 16
Views: 11203

Best way to setup a "Dictionary" similar to VBA?

Hi Folks - I have a situation where I am loading files to a target Oracle system. The first two letters of the data file dictate the Target application. Rather than extracting the first two letters of the data file then cycling through a bunch of IF ELSE IF logic, is there a way to create a mapping/...
by SIMMS7400
16 Jan 2021 04:58
Forum: DOS Batch Forum
Topic: Issue with executing a command in parallel
Replies: 2
Views: 2773

Issue with executing a command in parallel

Hi Folks - I have the following command that executes an Oracle utility: CALL C:\path\to\util\utility.bat operation Param1 Param2 Param3 Param4 Param5 Param6 && ( ECHO Successful : Execute Data Load Rule ) || ( ECHO Failed : Execute Data Load Rule ) The utility is java based. What it does is while e...
by SIMMS7400
12 Jan 2021 18:03
Forum: DOS Batch Forum
Topic: Best way to parse out string from output? Is this acceptable?
Replies: 6
Views: 4408

Re: Best way to parse out string from output? Is this acceptable?

Compo -

This works like a charm! Will do some more testing but so far so good, Thank you so much!!!
by SIMMS7400
09 Jan 2021 04:06
Forum: DOS Batch Forum
Topic: Best way to parse out string from output? Is this acceptable?
Replies: 6
Views: 4408

Re: Best way to parse out string from output? Is this acceptable?

HI Antonio - Thank you so much! So for the most part, there should always b e those two conditions (the two slashes for the date at the beginning as well as the two slashes just before the <name_XXXX>.log. However, to ensure it's dynamic, is there a way to extract the string based on the other strin...
by SIMMS7400
08 Jan 2021 03:10
Forum: DOS Batch Forum
Topic: Best way to parse out string from output? Is this acceptable?
Replies: 6
Views: 4408

Re: Best way to parse out string from output? Is this acceptable?

Compo - thanks for the reply and great question. The lines are not wrapped. It outputs to a file and I can confirm with 100% certainty lines are not wrapped.

Thank you!
by SIMMS7400
07 Jan 2021 19:20
Forum: DOS Batch Forum
Topic: Best way to parse out string from output? Is this acceptable?
Replies: 6
Views: 4408

Best way to parse out string from output? Is this acceptable?

Hi Folks - I have a need to extract a certain string from an output. What I do is spool all output from my command into a variable and then parse that variable. THe output varies in row count, it's never the same. But, the string in which I need to extract always has "logfilename" in the line. Here ...
by SIMMS7400
01 Jan 2021 04:54
Forum: DOS Batch Forum
Topic: forfiles used with echo modifiying date modified?
Replies: 1
Views: 2436

Re: forfiles used with echo modifiying date modified?

Hi folks, is there another way to go about this to meet my need? Thanks!
by SIMMS7400
22 Dec 2020 14:30
Forum: DOS Batch Forum
Topic: JREPL Usage - read text file with commas and replace empty value
Replies: 12
Views: 10272

Re: JREPL Usage - read text file with commas and replace empty value

HI Dave -

Thank you, just wanted to confirm there wasn't another switch I was missing. THanks again!!
by SIMMS7400
21 Dec 2020 15:02
Forum: DOS Batch Forum
Topic: JREPL Usage - read text file with commas and replace empty value
Replies: 12
Views: 10272

Re: JREPL Usage - read text file with commas and replace empty value

HI Dave -

Is there a way to prevent that empty file creation if no altered lines are detected? Or do I just need to have another line of code to delete the empty file?

Thanks!