Error in for sentence robotframework - csv

Hi im reading a CSV file (to get information from a WEB Service) with this values:
169233xxx
169129xxx
189925xxx
This is my keyword definition:
Carga RUTs
[Documentation] Carga lista de RUTs a validar desde archivo csv
[Arguments] ${file_name}
${data}= read csv file ${file_name}
[return] ${data}
I catch this values in a for:
Consultar WS
[Documentation] Lee RUTs de archivo csv y consulta cada uno al Experto Original y Migrado.
[Arguments] ${data}
${rutsd}= Set Variable 0
Log To Console .
:FOR ${element} IN #{data}
\ ${rutsd}= Fetch From Left ${element}[0] ;
\ ${dvymas}= Get Substring ${element}[0] -2
\ Log To Console Consultando RUT ${rutsd}...
\ Run Keyword And Continue On Failure WS Experto Orignal ${rutsd}
At the moment of consulting....Appears for each "[" or "$apos" icon , i dont understand
<ns1:rut>['189925xxx </ns1:rut>
<ns1:rut>[$apos 189925xxx </ns1:rut>
At finally response:
Server raised fault: '1001: RUT no Válido' (translate DNI invalid(
Can someone explain to me why I am getting this error?
Thanks,
Regards!!
EDIT:
To not creat a new post i have a new error, i modified
${element}[0] for #{element}[0]
The previous error was solved.
Now i have a new error:
List variable '#{element}' has no item in index 0
Can someone explain to me why I am getting this error?
thanks again

Related

SAS : PROC IMPORT CSV - Encoding - specific caractere in columns names

How can we import a csv file with specific caractere in colnames ? When I open this CSV with Visual Code, 2 colnames contain this caractere �. Is there a way to import my file with proc import (not a datastep) ?
SAS version 9.04
I try this :
filename test2 "my_file.csv" encoding="utf-8" ;
proc import datafile= test2
out=my_df
dbms=dlm
replace;
delimiter=";";
getnames=yes;
GUESSINGROWS=MAX;
run;
Raise an error :
ERROR: Invalid string.
ERROR: Invalid string.
ERROR: Invalid string.
Nombre de noms trouvé inférieur au nombre de variables trouvé.
Le nom n'est pas un nom SAS correct.
Problèmes détectés dans les noms fournis. Consultez le Journal.
....
ERROR: Invalid string.
FATAL: Unrecoverable I/O error detected in the execution of the DATA step program. Aborted during
the EXECUTION phase.
Do the trick encoding="Windows-1250":
filename test2 "my_file.csv" encoding="Windows-1250" ;
proc import datafile= test2
out=my_df
dbms=dlm
replace;
delimiter=";";
getnames=yes;
GUESSINGROWS=MAX;
run;
Tips : to choose right encoding :
File > Import data > Choose your file ... > In open window click on "Codage ..." > In my case Codage "Europe de l'Ouest (Windows) (Page de code 1252) Import correctly "é" : check below in overview.
To have right syntax of encoding "1250" refers to : https://support.sas.com/documentation/onlinedoc/dfdmstudio/2.6/dmpdmsug/Content/dfU_Encodings.html

lsode function in octave

I wrote the code below and it worked for several weeks without any problem.
Suddenely it stoped working with following error:
"warning: lsode: passing function body as a string is obsolete; please use anonymous functions
warning: called from
heun at line 23 column 2
error: 'f' undefined near line 1 column 42
error: lsode: evaluation of user-supplied function failed
error: called from
__lsode_fcn__C__ at line 1 column 40
heun at line 23 column 2"
The code is:
function yn=euler(t0,y0,tend,f,n)
t0=input('Gib hier t0 ein:');
y0=input('Gib hier y0 ein:');
tend=input('Bis zu welchem Wert von t möchtest du y annährn?');
n=input('Gib hier die Anzahl der Schritte ein(n):');
fstrich=input('Wie lautet die Differentialgleichung?', 's');
f=inline('fstrich');
dt=(tend-t0)/n;
t(1)=t0;
y(1)=y0;
for i=1:n
t(i+1)=t(i)+dt;
y(i+1)=y(i)+f(t(i),y(i))*dt;
rotdim([flip(t) ; flip(y)])
scatter(t,y,'*')
hold on
f=inline('fstrich');
t=t0:0.001:tend;
y=lsode('f',y0,t);
plot(t,y)
Does anyone see a mistake or something I can change?
Apparently you updated octave.
f=inline('fstrich'); % this is discouraged
y=lsode('f',y0,t); % and this is not valid anymore.
Instead, make an anonymous function
f=str2func(fstrich);
y=lsode(f,y0,t);

Custom character for input

I am new to java, I am working with primefaces and as part of a capture for username I am being asked for this.
How can I customize the capture? You can capture numbers (0-9) and letters (a-zA-Z) but I also require: # $ & -_. How can I make special characters for this? Thanks in advance and an apology in case I do not ask the question correctly.
I already made several tests but I do not have the desired result. When I put the "&" character it marks me an error leaving it like this:
<o:validator
validatorId="javax.faces.RegularExpression"
pattern="^[#$-_.A-Za-z0-9\\+]+(\\.[#$-_.A-Za-z0-9]+)*"
message="La contraseña no tiene un formato válido." />
<p:outputLabel value="Contraseña:" for="newUserPwd1"/>
<p:password
id="newUserPwd1" value="#{userManagerView.pass1}" required="true"
requiredMessage ="La contraseña es obligatoria.">
<o:validator
validatorId="javax.faces.Length" minimum="6"
message="La contraseña requiere mínimo de 6 caracteres"/>
<o:validator
validatorId="javax.faces.RegularExpression"
pattern="^[#$-_.A-Za-z0-9\\+]+(\\.[#$-_.A-Za-z0-9]+)*"
message="La contraseña no tiene un formato válido." />
</p:password>
This is the error with the character &
Parsing Error /viewMetadata/admin/usuarios.xhtml: Error Traced [line: 172] A decimal representation must appear immediately after "& #
Caused by:
javax.faces.view.facelets.FaceletException - Error Parsing /viewMetadata/admin/usuarios.xhtml: Error Traced [line: 172] A decimal representation must appear immediately after "& #
at org.apache.myfaces.view.facelets.compiler.SAXCompiler.doCompileViewMetadata (SAXCompiler.java:838)

No keyword with name 'Fetch From Left' found

I'm automating with robot framework but I'm getting this error
No keyword with name 'Fetch From Left' found.
I don't understand the cause, I'm new in this tool
Here is my code:
${FILE_RUTS_INFORMACION_PERSONAL} archivo2.csv
Im reading CSV file with three DNI
Carga RUTs
[Documentation] Carga lista de RUTs a validar desde archivo csv
[Arguments] ${file_name}
${data}= read csv file ${file_name}
[return] ${data}
Here is the error:
Consultar WS
[Documentation] Lee RUTs de archivo csv y consulta cada uno al Experto Original y Migrado.
[Arguments] ${data}
${rutsd}= Set Variable 0
${dv} = Set Variable 0
Log To Console .
:FOR ${element} IN ${data}
\ ${rutsd}= Fetch From Left #{element}[0] ;
\ ${dvymas}= Get Substring #{element}[0] -1
\ ${dv}= Fetch From Left ${dvymas} ;
\ Log To Console Consultando RUT ${rutsd}...
\ Run Keyword And Continue On Failure WS Experto Orignal ${rutsd} ${dv}
ERROR:
FOR ${element} IN [ ${data} ]
Start / End / Elapsed: 20170823 10:00:11.149 / 20170823 10:00:11.151 / 00:00:00.002
00:00:00.002VAR ${element} = [['169233xxx;'], ['169129xxx;'], ['189925xxx;']]
Start / End / Elapsed: 20170823 10:00:11.149 / 20170823 10:00:11.151 / 00:00:00.002
00:00:00.000KEYWORD ${rutsd}= = Fetch From Left #{element}[0], ;
Start / End / Elapsed: 20170823 10:00:11.151 / 20170823 10:00:11.151 / 00:00:00.000
10:00:11.151 FAIL No keyword with name 'Fetch From Left' found.
You need to import the String library. See the user guide for more information. Only the BuiltIn library doesn't need to be imported. Looking at the code you posted, you don't seem to be importing it.
Adding this to your settings section should do the trick
*** Settings ***
Library String

Strsplit error parsing JSON using RJSON

I've got a well formated JSON string with a R script, but when I try to parse it using the rjson package (with parser$addData), I get this error :
>json <- fromJSON(docret)
>parser <- newJSONParser()
>parser$addData(json)
Erreur dans strsplit(buf, "") :
l'argument n'est pas une chaîne de caractères
My JSON string (docret here) is validated by two online JSON validators.
Can I do something about this error to have my JSON object usable?
Here is my JSON :
http://shrib.com/8dTgq90U