Good Morning,
I have a question how to schedule a BAT, I I have been researching but I am find the solution.
I have a text file into columns, this may have hundreds of rows.
PADRE;HIJO;FORMULA;PAIS
DC_IC;CG_IC;;
F_0356698;F_4567879345;Formula;
The FORMULA can be this.
Formula = /* Inicio Formula Asigna valores a país */ IF(@ISMBR("CBU","DES"))@SUM(@CHILDREN(@CURRMBR("Cl ients")));ENDIF; /* Asigna valores a Iberia */IF(@ISMBR("CBU","Iberia"))@SUM(@CHILDREN(@CURRMBR( "CBU")));ENDIF;;
The final file would be this:
“PADRE“,“HIJO“,“FORMULA“
“DC_IC“,“CG_IC“,“ “
“F_0356698“,“F_4567879345“,“Formula“
as I can get?
I think
I create a counter of semicolon (;)
At the beginning of each row you put the character you put "
If find the first ; then ; = “;”
If find the second ; then ; = “;”
At the end of each row you put the character you put "
Thanks
The problem an BATCH
Moderator: DosItHelp
-
- Posts: 21
- Joined: 19 Jul 2013 11:35
- Location: Brazil
Re: The problem an BATCH
Good Afternoon Xavisbd
I created a text file called inputFile.txt.In its content I wrote the text below:
PADRE;HIJO;FORMULA;PAIS
DC_IC;CG_IC;;
F_0356698;F_4567879345;/* Inicio Formula Asigna valores a país */ IF(@ISMBR("CBU","DES"))@SUM(@CHILDREN(@CURRMBR("Cl ients")));ENDIF; /* Asigna valores a Iberia */IF(@ISMBR("CBU","Iberia"))@SUM(@CHILDREN(@CURRMBR( "CBU")));ENDIF;;;
Take a look at the script below:
After run script, the file outputFile.txt is generated.Take a look and see:
"PADRE","HIJO","FORMULA","PAIS"
"DC_IC","CG_IC","",""
"F_0356698","F_4567879345"," /* Inicio Formula Asigna valores a país */ IF(@ISMBR("CBU","DES"))@SUM(@CHILDREN(@CURRMBR("Cl ients")))","ENDIF; /* Asigna valores a Iberia */IF(@ISMBR("CBU","Iberia"))@SUM(@CHILDREN(@CURRMBR( "CBU")));ENDIF;;;"
I hope that it help you Xavisbd.
See you
I created a text file called inputFile.txt.In its content I wrote the text below:
PADRE;HIJO;FORMULA;PAIS
DC_IC;CG_IC;;
F_0356698;F_4567879345;/* Inicio Formula Asigna valores a país */ IF(@ISMBR("CBU","DES"))@SUM(@CHILDREN(@CURRMBR("Cl ients")));ENDIF; /* Asigna valores a Iberia */IF(@ISMBR("CBU","Iberia"))@SUM(@CHILDREN(@CURRMBR( "CBU")));ENDIF;;;
Take a look at the script below:
Code: Select all
@echo off
cls
if exist outputFile.txt del outputFile.txt
for /F "tokens=1,2,3,* delims=;" %%a in (inputFile.txt) do (
echo "%%a","%%b","%%c","%%d" >> outputFile.txt
)
goto:eof
After run script, the file outputFile.txt is generated.Take a look and see:
"PADRE","HIJO","FORMULA","PAIS"
"DC_IC","CG_IC","",""
"F_0356698","F_4567879345"," /* Inicio Formula Asigna valores a país */ IF(@ISMBR("CBU","DES"))@SUM(@CHILDREN(@CURRMBR("Cl ients")))","ENDIF; /* Asigna valores a Iberia */IF(@ISMBR("CBU","Iberia"))@SUM(@CHILDREN(@CURRMBR( "CBU")));ENDIF;;;"
I hope that it help you Xavisbd.
See you
Re: The problem an BATCH
Hello,
the solution that you gave me, it was not correct . but it was of great help. because any changes I wanted to reach
Thanks
the solution that you gave me, it was not correct . but it was of great help. because any changes I wanted to reach
Thanks