Search found 27 matches

by joecepy
27 Feb 2015 12:48
Forum: DOS Batch Forum
Topic: Read file-> extract the sentence to extract word
Replies: 8
Views: 4631

Re: Read file-> extract the sentence to extract word

I copied and pasted few lines to show there are duplicate items
by joecepy
27 Feb 2015 12:43
Forum: DOS Batch Forum
Topic: Read file-> extract the sentence to extract word
Replies: 8
Views: 4631

Re: Read file-> extract the sentence to extract word

the items in a single quote so '}ElementAttributes_}Groups' '}ElementSecurity_project' '}ElementAttributes_project_lob_history' '}ElementSecurity_project_lob_history' '}ElementAttributes_}Groups' '}ElementSecurity_project_lob_history' '}ElementAttributes_project' 'CPX_DETAIL' but it has to be unique...
by joecepy
27 Feb 2015 12:03
Forum: DOS Batch Forum
Topic: Read file-> extract the sentence to extract word
Replies: 8
Views: 4631

Read file-> extract the sentence to extract word

I have following text 10444 [] INFO 2015-02-25 00:57:59.040 TM1.Process Process QueBIT Sample - Turn On Cube Logging executed by chore Admin.Enable.Cube.Logging.30min.Interval 10456 [] INFO 2015-02-25 01:00:29.859 TM1.Cube.Dependency Adding cube dependency: Cube '}ElementAttributes_project_lob_histo...
by joecepy
10 Feb 2015 21:20
Forum: DOS Batch Forum
Topic: search string
Replies: 6
Views: 5048

Re: search string

What the heck are you trying to do with this? ( echo AddCubeDependency('%%i', '%%j&'^)^; set %%i_%%j=*)) I was trying to take Yuri's code and change it up little but it's driving me crazy. I just want to echo out the text little bit. I changed it a little for readability but it's gets worse and...
by joecepy
10 Feb 2015 20:42
Forum: DOS Batch Forum
Topic: search string
Replies: 6
Views: 5048

Re: search string

Code: Select all


@<"in.txt">"out.txt" (
for /f "tokens=2,4 delims='" %%i in ('more') do @if not defined %%i_%%j ( echo AddCubeDependency('%%i', '%%j&'^)^; set %%i_%%j=*))


why is code above not working?
by joecepy
10 Feb 2015 19:59
Forum: DOS Batch Forum
Topic: search string
Replies: 6
Views: 5048

Re: search string

The code: @<"in.txt">"out.txt" (for /f "tokens=2,4 delims='" %%i in ('more') do @if not defined %%i_%%j (echo Cube: %%i on %%j& set %%i_%%j=*)) .[/quote] it works but I don't understand why it works...I tried changing the echo part and then it doesn't work anymore. ...
by joecepy
10 Feb 2015 15:58
Forum: DOS Batch Forum
Topic: search string
Replies: 6
Views: 5048

search string

I have following file that contains following text... 11072 [646] INFO 2015-02-10 14:31:58.759 Dependency Adding cube: Cube 'DETAIL1' depends on cube 'INFO_BLAH1'. 11072 [646] INFO 2015-02-10 14:31:58.759 Dependency Adding cube: Cube 'DETAIL' depends on cube 'INFO_BLAH'. 9764 [62f] INFO 2015-02-10 1...
by joecepy
06 Jan 2015 22:12
Forum: DOS Batch Forum
Topic: for loop if file exists
Replies: 8
Views: 5204

Re: for loop if file exists

Squashman wrote:

Code: Select all

move %%x %%~dpx\Archive


You rock! have a good night sir.
by joecepy
06 Jan 2015 21:39
Forum: DOS Batch Forum
Topic: for loop if file exists
Replies: 8
Views: 5204

Re: for loop if file exists

You specify the path you want to search after the /R option. FOR /R [[drive:]path] %variable IN (set) DO command [command-parameters] Walks the directory tree rooted at [drive:]path, executing the FOR statement in each directory of the tree. If no directory specification is specified after /R then ...
by joecepy
06 Jan 2015 21:03
Forum: DOS Batch Forum
Topic: for loop if file exists
Replies: 8
Views: 5204

Re: for loop if file exists

so what is going on here... for debugging I echo %%f and it prints out the path of %sTransferLogFile% rather than the content. Any thoughts? EDIT: so I resolved the first for loop by using 'type %sTransferLogFile% ' but now I'm getting issue with second for loop. I tried single quote but doesn't see...
by joecepy
06 Jan 2015 20:45
Forum: DOS Batch Forum
Topic: for loop if file exists
Replies: 8
Views: 5204

Re: for loop if file exists

Squashman wrote:If exist %%x


still reporting all NOT FOUND

edit: my bad you're a genius that worked thanks
by joecepy
06 Jan 2015 20:28
Forum: DOS Batch Forum
Topic: for loop if file exists
Replies: 8
Views: 5204

for loop if file exists

Anyone know why the following reports NOT FOUND for all files that are in the log file? I know they exist in subdirectory so /r should recurse through the subdirectory but it always report NOT FOUND setlocal enabledelayedexpansion for /f "tokens=* delims=" %%f in (.\transferFile.log) do ( ...
by joecepy
06 Jan 2015 20:24
Forum: DOS Batch Forum
Topic: parse text file
Replies: 5
Views: 4188

Re: parse text file

found solution. I was racking my brain but it was simpler that I expected. And your solution was? @ECHO OFF &SETLOCAL for /f "delims=" %%a in ('^<20150601_150617.scp.log find "-rw-r--r--"') do call:DOit "%%~a" goto:Eof :doit setlocal set "string=%~1" set ...
by joecepy
06 Jan 2015 16:06
Forum: DOS Batch Forum
Topic: parse text file
Replies: 5
Views: 4188

Re: parse text file

found solution. I was racking my brain but it was simpler that I expected.