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
Related
I'm trying to import a .json into a database using MySQL workbench, but the "Table data import wizard" always end up with 0 records.
here's the first line of my .json:
{
"Title":"Fort de Villiers",
"Keywords":"Histoire",
"Descripion":"Le fort de Villiers est un ancien fort du système défensif de Paris, situé sur la commune de Noisy-le-Grand, dans le département français de Seine-Saint-Denis. Construit à la fin du XIXᵉ siècle, il faisait partie du système Séré de Rivières, destiné a établir un rideau défensif autour de Paris.",
"Images":["https://lh3.googleusercontent.com/proxy/J-7ut85_OfCJn33_EZcooBkGyjxGBXt5CifUJ_bGzHaZUHlT4XVYwNaIKpZ4hScn3ICcUMI12RZ4xzTxUGmN1LCK694hynag4zh68dLypDwQ_Gy9NwCIFweGTjkh3Wft4IMr0No1tFWbTQ6oBnmLgRaomsWzvoJrTa8=w296-h202-n-k-no","https://lh5.googleusercontent.com/p/AF1QipNs2wi72SiKVlLr1WHIPfAaATrXOfhswYWEIaOw=w296-h202-n-k-no","https://lh5.googleusercontent.com/p/AF1QipMIY16VgeazmwQAP7PB5biaq5p-9uE3OZ-zVYZB=w296-h202-n-k-no"],
"Lattitude":"48.833573",
"Longitude":"2.5463771",
"Map_url":"https://www.google.com/maps/place/Fort+de+Villiers/#48.833573,2.5463771,15z/data=!4m5!3m4!1s0x47e60e0d72beac57:0xd4b8549d2165eef7!8m2!3d48.8335733!4d2.5551319"
}
when i try to import it, i got those fields proposed:
Title : Text
Description : Text
Longitude : Double
Images : json
Map_url : Text
Keywords : Text
Lattitude : Double
With some research i found out that it may be that the "text" columns countains characters that doesn't fill the requiring format, but i didn't manage to get the right format.
Do i need to modify my .json to get a correct utf8 format?
I'm actually using mysql 8.
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)
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
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
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