Search found 11 matches

by mimismo
18 Jun 2016 09:01
Forum: DOS Batch Forum
Topic: Passing variable to subroutine
Replies: 13
Views: 10166

Re: Passing variable to subroutine

Hi Team, thank you for all your hints. Finally I was able to make works my script and I wanted to share with you it and I know this code easily can be tuned for you guys, now I'm feel satisfied by my first a bit complex script I've done. Please let me explain in a brief what I did and in commented w...
by mimismo
16 Jun 2016 22:47
Forum: DOS Batch Forum
Topic: Question on Simple nested FOR
Replies: 3
Views: 4132

Re: Question on Simple nested FOR

Thank you Antonio, now the code works well A quick question, does it matter if I use "usebackq" switch in the outside FOR or it should be in the inside FOR. I tested in both ways and it works and the only difference was that in the outside FOR, the output repeats the source code in each it...
by mimismo
16 Jun 2016 21:30
Forum: DOS Batch Forum
Topic: Question on Simple nested FOR
Replies: 3
Views: 4132

Question on Simple nested FOR

Hi I have a text file named "All Files.txt" containing a list of another csv files. I want to get a variable that contains each row value in the nested FOR of the csv files listed in "All Files.txt" Let me show my code and the output @echo on setlocal EnableDelayedExpansion for /...
by mimismo
15 Jun 2016 14:37
Forum: DOS Batch Forum
Topic: Passing variable to subroutine
Replies: 13
Views: 10166

Re: Passing variable to subroutine

Thank you foxidrive The main problem is that there are no names based in some logic for all files. The only logic behind that is that for each server the monitoring tool generates a file ending with .csv and the next file ends with csv.1 and so on Please find below the example of the names and each ...
by mimismo
15 Jun 2016 09:30
Forum: DOS Batch Forum
Topic: Concatenation in for loop
Replies: 8
Views: 7100

Re: Concatenation in for loop

Hi sambul35 Thank you for your quick response, I'd already set the "setlocal EnableDelayedExpansion" command and I've tried using !Tem! but it seems is the same situation, using a variable as input, batch file reads the file name but I didn't go through the content of the file. I'm becomin...
by mimismo
15 Jun 2016 08:06
Forum: DOS Batch Forum
Topic: Concatenation in for loop
Replies: 8
Views: 7100

Re: Concatenation in for loop

Hi Antonio I have a quick question, the code you shared me works great, but the only thing I've noticed is when I've tried to use it as a block of another extra code. If I use that code in a subroutine passing a variable instead of a file name, the concatenation didn't work. Debugging the code, I ca...
by mimismo
15 Jun 2016 07:39
Forum: DOS Batch Forum
Topic: Passing variable to subroutine
Replies: 13
Views: 10166

Re: Passing variable to subroutine

Please let me explain in detail what I want to do. I have hundred of files like this examples: Each txt file contain a variable rows between one to ten every one in one line and none of them are blank rows and at least there is one row in each file All those files contains values from monitoring too...
by mimismo
13 Jun 2016 10:32
Forum: DOS Batch Forum
Topic: Passing variable to subroutine
Replies: 13
Views: 10166

Re: Passing variable to subroutine

All those text files are separated in a new line each and none of the text files have one line, at least they have minimum 2 lines. I've modified my code and nested all four steps needed in a FOR loops Please take a look ============================================= echo "Number 1 for /F "...
by mimismo
12 Jun 2016 16:19
Forum: DOS Batch Forum
Topic: Passing variable to subroutine
Replies: 13
Views: 10166

Passing variable to subroutine

Hi, this is part of my code: ======================================== setlocal EnableDelayedExpansion for /F "tokens=*" %%A in (All_csv.txt) do ( dir /b "%%A"* > "%%A".txt ) for /F "tokens=*" %%A in ("%%A") do ( call :Delete_Last_Line '%%A' ) :Delete...
by mimismo
11 Jun 2016 12:17
Forum: DOS Batch Forum
Topic: Concatenation in for loop
Replies: 8
Views: 7100

Re: Concatenation in for loop

Hi Squashman, you are right, I missed file extension in my post, sorry, but it should be included...

Hi Aacini, your code works as I was expected
Thank you for your help

Happy weekend
by mimismo
11 Jun 2016 09:41
Forum: DOS Batch Forum
Topic: Concatenation in for loop
Replies: 8
Views: 7100

Concatenation in for loop

Hi Team I'm wondering if you could help me. This is my request I have a text file containing N number of lines betwen one and ten, who has spaces in between each row. This is an example of my file: MyTextFile.txt String1 numer1.txt String2 number2.txt String3 number3.txt All rows in the file MyTextF...