Informatica Cloud- Null character issue in from dat file - informatica-cloud

I am getting the following task error in Informatica Cloud.
FR_3085 ERROR: Row [1]: 2-th character is a null character, which is not allowed in a text input file d:\temp\psaas.csv.
How to fix this issue, I tried to use ReplaceStr(0, input, char(10), '') in the filter condition, but its still throwing me an error?
thanks
Bhavesh

What character set do you have set for the connector? You may need to set it to windows character or make sure your file is using UTF-8. Attaching the source file may help to understand the issue.

Your input file contains some invalid characters.
You can fix this issue by changing the file encoding.
Try to change the file encoding to "UTF-8" or "ANSI". Save the file and restart the job.

Related

read_csv doesn't get accents correctly

I'm reading a UTF-8 encoded file with readr::read_csv("path_to/file.csv", locale = locale(encoding = "utf-8")) but still doesn't get the spanish accents correctly.
I wrote the file with readr::write_csv(file, "path_to/file.csv") and the output of readr::guess_encoding("path_to/file.csv") is UTF-8 with 100% confidence.
As a side note, eveytime I wrote the file, the R session run into fatal error, but the file was still written.
What can I do to get strings with correct accents?
EDIT
I've found this issue in readr's github repo, pointing out that the error should disappear with the latest vroom release, but in my case didn't.
I have solved the accent marks issue: when calling my funs.R file, which contains all relevant functions on data preprocessing and was used before writting the csv, I wasn't doing it correctly. Apparently, file sourcing is done with R's defult encoding, which isn't necessarily the same encoding of the file itself. I just had to set encoding = "utf-8" argument into source().
I wasn't able to resolve the fatal error.

Incorrect column name after loading csv

After loading csv, the name of the first column changed from "communityname" to "Êcommunityname".
crime=read.csv('crimedata.csv',check.names=FALSE)
Any one knows why and how to solve it?
Try to correct your Encoding. Try to use fileEncoding to correct it!

Error opening .jpg with readJPEG in R because of accent in path

I'm working in a directory where the path have one string with accent (C:\Users\Zá\Documents).
I set this path as defalt and I already use this same path to others functions like read.csv and it works fine.
When I tried to use this path in readJPG I get an error message.
I alredy tried to use normalizePath, but the error continues.
I am using UTF-8 as default text encoding.
setwd("C:\Users\Zá\Documents\")
img1<-readJPEG("~\gd.jpg", native = T )
Error in readJPEG("~\gd.jpg", native = T):unable to open C:\Users\Zá\Documents\gd.jpg
Does anyone have an idea how can I fix it ?
Thanks all.

Track the exact place of a not encoded character in an R script file

more a tip question that can save lots of time in many cases. I have a script.R file which I try to save and get the error:
Not all of the characters in ~/folder/script.R could be encoded using ASCII. To save using a different encoding, choose "File | Save with Encoding..." from the main menu.
I was working on this file for months and today I was editing like crazy my code and got this error for the first time, so obviously I inserted a character that can not be encoded while I was working today.
My question is, can I track and find this specific character and where exactly in the document is?
There are about 1000 lines in my code and it's almost impossible to manually search it.
Use tools::showNonASCIIfile() to spot the non-ascii.
Let me suggest two slight improvements this.
Process:
Save your file using a different encoding (eg UTF-8)
set a variable 'f' to the name of that file. something like this f <- yourpath\\yourfile.R
Then use tools::showNonASCIIfile(f) to display the faulty characters.
Something to check:
I have a Markdown file which I run to output to Word document (not important).
Some of the packages I used to initialise overload previous functions. I have found that the warning messages sometimes have nonASCII characters and this seems to have caused this message for me - some fault put all that output at the end of the file and I had to delete it anyway!
Check where characters are coming back from Warnings!
Cheers
Expanding the accepted answer with this answer to another question, to check for offending characters in the script currently open in RStudio, you can use this:
tools::showNonASCIIfile(rstudioapi::getSourceEditorContext()$path)

Unexpected input error in Shiny, but unable to locate the source of error

I am getting the unexpected input error in UI.R, as follows:
ERROR: C:\Users\myApp/ui.R:1:2: unexpected input
1: ï»
However, when I try to locate the error at line 1, there is absolutely nothing of the form ï».
To resolve this error, I tried saving my UI.R file as a text file and changing the encoding to UTF-8, but this still does not remove the strange character. I also tried removing the first couple of lines and re-writing the code, but it still gives the same error!
How can I remove this character? Should I use another text editor?
I am using base R, not R Studio. And I had copy-pasted my code form my GitHub account, if that info is required...
Code from my file can be viewed here.
Many thanks.
I have this same issue in the year '19, and took me a while to run into this question from the year '14.
Not Shiny, but a regular R project with its .Rprofile.
The solution that worked for me is:
Open your file in Notepad++. From the Encoding menu, select Convert to UTF-8 (without BOM), save the file, replace the old file with this new file. And all is fixed.

Resources