Search found 546 matches

by SIMMS7400
03 Jan 2022 04:34
Forum: DOS Batch Forum
Topic: How to arrange and array/list?
Replies: 3
Views: 5173

Re: How to arrange and array/list?

I suppose I was over thinking. I can force the order I need to process the files in based on my array definition. Here is what I came up with and it works, but not sure if this is considered "too clunky". I'm sure there are better ways? @echo off setlocal EnableDelayedExpansion SET "FILE_BIN=C:\TEMP...
by SIMMS7400
03 Jan 2022 02:36
Forum: DOS Batch Forum
Topic: How to arrange and array/list?
Replies: 3
Views: 5173

Re: How to arrange and array/list?

Squash - Either my explanation wasn't good enough or you're still hitting the egg-nog. Dave's JSORT solution does not work for me in this situation. I'm not looking to sort file contents or files themselves. As stated, I'm using the 4th position in my array/list definition to dictate how I need to p...
by SIMMS7400
02 Jan 2022 17:54
Forum: DOS Batch Forum
Topic: How to arrange and array/list?
Replies: 3
Views: 5173

How to arrange and array/list?

Hi Folks - I have the following array (well, I believe it's technically called a "list): @echo off setlocal EnableDelayedExpansion FOR %%A IN ( "CITY.txt|CITY_JOB|CITY_Errors.zip|" "COUNTY.txt|COUNTY_JOB|COUNTY_Errors.zip|2" "REGION.txt|REGION_JOB|REGION_Errors.zip|1" ) DO SET "GROUP=%%~A" & CALL :D...
by SIMMS7400
27 Dec 2021 14:33
Forum: DOS Batch Forum
Topic: How to force processing of certain files first in for loop?
Replies: 3
Views: 4016

Re: How to force processing of certain files first in for loop?

Well, I figured out a way to do it and it's working as expected although not sure if this is an acceptable approach. Essentially, I"m running over the files first before I process them to check an array definition I set. If a specific OLU_TYPE is set, then modfy the data modify. Then, when I begin t...
by SIMMS7400
23 Dec 2021 07:20
Forum: DOS Batch Forum
Topic: How to force processing of certain files first in for loop?
Replies: 3
Views: 4016

Re: How to force processing of certain files first in for loop?

HI Antonio - Yes you're right, allow me to provide some more context! 1. Can be any number of files (1-1000) 2. Can have diferent extensions 3. The "first files" can be processed in any order so long as they are processed BEFORE the others 4. I have a list (or an array) setup which defines the files...
by SIMMS7400
23 Dec 2021 02:54
Forum: DOS Batch Forum
Topic: How to force processing of certain files first in for loop?
Replies: 3
Views: 4016

How to force processing of certain files first in for loop?

HI All - I have a data process I'm building for a client. All files are staged in a single directory so I'm using a for loop to consume all files and process accordingly. However, there are certain files I need to process first just to requirement from within the target application that I"m importin...
by SIMMS7400
24 Sep 2021 04:12
Forum: DOS Batch Forum
Topic: Array construction with empty value
Replies: 9
Views: 10524

Re: Array construction with empty value

Antonio - Thank you very much! I understand now. This certainly increases the risk of errors (if the line isn't truly blank) etc. I will work with it for now and the conver to your other method. Which I have a question on, how do I sent multiple "data" lines? For instance, what if I have 5 "data" li...
by SIMMS7400
23 Sep 2021 12:26
Forum: DOS Batch Forum
Topic: Array construction with empty value
Replies: 9
Views: 10524

Re: Array construction with empty value

If I put double quotes around it, it works (doesn't bomb) but then the value has two sets of quotes instead of one...hmmm DLR_DATA_FDRII1,DLR_DATA_FDRII1 inbox/LOC_DATA_FDRII Mode=""REPLACE Data"" If I do this, it works, but seems a bit clunky to remove the quotes: FOR %%a IN ( "FDR|DLR_DATA_FDRII,D...
by SIMMS7400
23 Sep 2021 12:17
Forum: DOS Batch Forum
Topic: Array construction with empty value
Replies: 9
Views: 10524

Re: Array construction with empty value

HI Aacini - Thank you very much!! I really like your methodology and I'm going to poke around with it now! In the mean time, I still need to leverage my current methods until I'm able to make the switch. With that said, I do believe I still need my first for loop otherwise it does not cycle through ...
by SIMMS7400
23 Sep 2021 11:19
Forum: DOS Batch Forum
Topic: Best way to pull out specifc lines from text file? JREPL?
Replies: 6
Views: 8150

Re: Best way to pull out specifc lines from text file? JREPL?

Aacini - that worked like a charm!! Thank you!!
by SIMMS7400
23 Sep 2021 03:47
Forum: DOS Batch Forum
Topic: Best way to pull out specifc lines from text file? JREPL?
Replies: 6
Views: 8150

Best way to pull out specifc lines from text file? JREPL?

HI Folks - I have the following text file that is an output from a data load process I run. I need to scan the file and if an instance of "| Error: " is found, I need to create another file with a header and applicable rows. Here is my file which I have pulled out at the etra garbage to keep it shor...
by SIMMS7400
21 Sep 2021 02:09
Forum: DOS Batch Forum
Topic: Array construction with empty value
Replies: 9
Views: 10524

Re: Array construction with empty value

Thank you, Terry!! Your suggestion is working great for me!!
by SIMMS7400
18 Sep 2021 08:33
Forum: DOS Batch Forum
Topic: Array construction with empty value
Replies: 9
Views: 10524

Re: Array construction with empty value

Found a couple old threads and this is what I came up with: @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION FOR %%a IN ( "FDR|DLR_DATA_FDRII,DLR_DATA_FDRII|inbox/LOC_DATA_FDRII||STORE_DATA" ) DO FOR /F "eol=' delims=" %%G IN ("%%a") DO ( SET "L=%%~G" REM add a backslash (or other character) in front of ev...
by SIMMS7400
18 Sep 2021 08:04
Forum: DOS Batch Forum
Topic: Array construction with empty value
Replies: 9
Views: 10524

Array construction with empty value

Hi Folks - This may be a stupid question. I have the following array: FOR %%a IN ( "FDR|DLR_DATA_FDRII,DLR_DATA_FDRII|inbox/LOC_DATA_FDRII|REPLACE|STORE_DATA" ) DO FOR /F "tokens=1-4 delims=|" %%A IN (%%a) DO ( SET "STR[%%A].DLR=%%B" SET "STR[%%A].LOC=%%C" SET "STR[%%A].IMP=%%D" SET "STR[%%A].EXP=%%...
by SIMMS7400
18 Sep 2021 07:57
Forum: DOS Batch Forum
Topic: Question with Array setup
Replies: 12
Views: 12699

Re: Question with Array setup

Thanks Squash and Aacni - both options worked great!