Search found 423 matches

by SIMMS7400
18 Mar 2019 18:16
Forum: DOS Batch Forum
Topic: Lag methodology
Replies: 5
Views: 107

Re: Lag methodology

Hi All -

Thank for the links! I'm been playing around with that but can't seem to get anything worth that would be dynamic enough. Was hoping this was a quick hit. Does anyone mind sharing an example I could extrapolate on?

Gracias!
by SIMMS7400
14 Mar 2019 05:14
Forum: DOS Batch Forum
Topic: Lag methodology
Replies: 5
Views: 107

Lag methodology

Hi Folks - I have a unique need to implement a lag type of methodology. For instance, I have a date variable set as such: SET "DATEVAR=31-Jan-18" I also need to set (4) additional variable that lag 4 days. For instance: SET "DATEVAR1=30-Jan-18" SET "DATEVAR2=29-Jan-18" SET "DATEVAR3=28-Jan-18" SET "...
by SIMMS7400
23 Jan 2019 16:05
Forum: DOS Batch Forum
Topic: Manipulating a variable
Replies: 2
Views: 144

Re: Manipulating a variable

I played around and got this to work, but not sure if it's the most efficient? SET "CLOUD_URL=https://planning-z552xxx1.pbcs.us2.oraclecloud.com" SET "SEARCH=test" ECHO "%CLOUD_URL%" | FINDSTR /C:"%SEARCH%" >nul 2>&1 && ( SET "FLAG=T" ) IF DEFINED FLAG FOR /F "tokens=1,3 delims=-" %%A IN ("%CLOUD_UR...
by SIMMS7400
23 Jan 2019 15:45
Forum: DOS Batch Forum
Topic: Manipulating a variable
Replies: 2
Views: 144

Manipulating a variable

Hi Folks - I have a variable defined as such: SET "CLOUD_URL=https://planning-z552xxx1.pbcs.us2.oraclecloud.com" What I need to do is if the variable above does not have the string "test" in it, I need to add it. Like such: SET "CLOUD_URL=https://planning-test-z552xxx1.pbcs.us2.oraclecloud.com" And ...
by SIMMS7400
13 Jan 2019 14:57
Forum: DOS Batch Forum
Topic: robocopy help please
Replies: 5
Views: 275

Re: robocopy help please

Damn Millennials...

Please try a few different things and come back with your results.
by SIMMS7400
09 Jan 2019 19:54
Forum: DOS Batch Forum
Topic: FOR LOOP Question - Delimiters
Replies: 2
Views: 196

FOR LOOP Question - Delimiters

Hi Folks - I have what I believe is a very easy question. If I have a file with a line: ,Total Tire Centers And my FOR LOOP looks like this: FOR /F "USEBACKQ TOKENS=1-2 DELIMS=," %%A IN ("%CNTRL_FILE%") DO ECHO "%%~A" "%%~B" Why does "%%~A" return "Total Tire Centers" instead of just ""? Ideally, I ...
by SIMMS7400
21 Dec 2018 17:12
Forum: DOS Batch Forum
Topic: Advice Question - how to check to see if file has already been ran?
Replies: 3
Views: 226

Advice Question - how to check to see if file has already been ran?

Hi Folks - I have a process that consumes data files from a specific directory and then loads into a target application. However, after the load, the files are not moved/archived. Therefore, when I access the directory with each call to the function, the same file is read into the for loop again obv...
by SIMMS7400
12 Dec 2018 13:33
Forum: DOS Batch Forum
Topic: 7zip issues
Replies: 2
Views: 214

Re: 7zip issues

Thanks Squash.

I ended up making an exclusion list and passing that in instead - works fine now!

Thank you!

Best,
C
by SIMMS7400
12 Dec 2018 11:45
Forum: DOS Batch Forum
Topic: 7zip issues
Replies: 2
Views: 214

7zip issues

Hi Folks - I'm banging my head against the wall on trying to exclude a certain directory from my archive process. SET "ASCENDDRIVE3=\\server.client.com\TM1_CDM_Data\Target" SET "PDD_ZIP_PATH=%ASCENDDRIVE3%\Archive\PDD_TO_DATAHUB_OB_FILES_%DATETIME%.zip" CALL "7z.exe" a -tzip "%PDD_ZIP_PATH%" "%ASCEN...
by SIMMS7400
10 Dec 2018 02:54
Forum: DOS Batch Forum
Topic: Batch subtraction with leading zero
Replies: 2
Views: 211

Re: Batch subtraction with leading zero

HI Squash -

Ah yes, very easy!

This solves for my issue, but looks awfully clunky.

Code: Select all

SET "ENDYEAR=%DATAFILENAME:~-6%"
SET "ENDYEAR=%ENDYEAR:~0,2%"
SET /A "STARTYEAR=1%ENDYEAR%-1"
SET "STARTYEAR=%STARTYEAR:~1,3%"
SET "STARTPOV=Sep-%STARTYEAR%" & SET "ENDPOV=Oct-%ENDYEAR%"
by SIMMS7400
09 Dec 2018 19:01
Forum: DOS Batch Forum
Topic: Batch subtraction with leading zero
Replies: 2
Views: 211

Batch subtraction with leading zero

Hi Folks - I am building a process that requires me to extract the year from a file name. The file name is as follows: hp_profitandloss_extract_FY08.csv The year will always be the last string preceeding the .csv. I need to extract the year and set it in a variable and also set another variable that...
by SIMMS7400
02 Dec 2018 09:28
Forum: DOS Batch Forum
Topic: Parsing taking FOREVER - possible JSCRIPT solution?
Replies: 6
Views: 335

Re: Parsing taking FOREVER - possible JSCRIPT solution?

Another method that have not the restrictions of my previous one... @echo off setlocal EnableDelayedExpansion rem Extract desired values (for /F "tokens=2 delims=|" %%a in (FDRII_outline.txt) do ( set "value=%%~a" if "!value:~0,2!" equ "C-" echo !value! )) > out1.txt rem Sort desired values (this i...
by SIMMS7400
02 Dec 2018 08:40
Forum: DOS Batch Forum
Topic: Parsing taking FOREVER - possible JSCRIPT solution?
Replies: 6
Views: 335

Re: Parsing taking FOREVER - possible JSCRIPT solution?

HI Shadow -

Nope, Sorting doesn't matter at all as long as the final file result has removed the duplicate(s) and the original.

Example:

Before:
1
2
3
1
1
4
5
After:
2
3
4
5
Thanks!
by SIMMS7400
02 Dec 2018 05:01
Forum: DOS Batch Forum
Topic: Parsing taking FOREVER - possible JSCRIPT solution?
Replies: 6
Views: 335

Parsing taking FOREVER - possible JSCRIPT solution?

Hi Folks - I have a text file that consists of 85k rows. I have a need to parse that file and extract from token 2 only strings that begin with "C-" and spool those results to a file. From there, I need to remove all duplicates from that file. THe end result should be a file containing NO duplicates...
by SIMMS7400
15 Nov 2018 08:56
Forum: DOS Batch Forum
Topic: Special Chracters in file
Replies: 2
Views: 325

Special Chracters in file

Folks - I'm trying to parse the following file: Update,Target Type,FP&A,Workforce,Real Estate,file1,file2 Update Legal Entity,TRUE,DEV,TRUE,TRUE,FALSE,REG1, test.csv However, as you can imagine, I'm not able to parse the first row due to the special chracters. I think I need to toggle between delaye...