Displaying 20 results from an estimated 95 matches for "fileencoding".
2010 Jun 22
3
Problem with writing a CSV file in UTF-8 formate
Hi all,
I have a problem with writing a *.CSV file in UTF-8 formate
I tried to write a dataframe named "dfPREINDX" to the new file named
"preindx.csv" in below formate
write.table(dfPREINDX,PreIndex,fileEncoding="UTF-8",sep="|",row.names=FALSE)
but its throed an error like
Error in write.table(dfPREINDX, "preindx.csv", fileEncoding = "UTF-8", sep =
"|", :
unused argument(s) (fileEncoding = "UTF-8")
can any one please help me how to create a...
2017 Apr 29
2
Any progress on write.csv fileEncoding for UTF-16 and UTF-32 ?
...ssions), on Windows 10.
For me, that means dealing with Windows-1252 and UTF-8 encoding, with UTF-16
and UTF-32 as helpful curiosities.
Something as simple as iconv ("\n", to = "UTF-16") causes an error, due to
an embedded nul.
Then there is write.csv (or write.table) with its fileEncoding parameter:
not working correctly for UTF-16 and UTF-32.
Of course, developers are aware of this, for example
[Rd] iconv to UTF-16 encoding produces error due to embedded nulls
(write.table with fileEncoding param)
https://stat.ethz.ch/pipermail/r-devel/2016-February/072323.html
iconv to UTF-16...
2011 Nov 24
0
R-2.14.0: read.csv2 with fileEncoding="UTF-8"
...1252
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
[5] LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
running under Windows Server 2008.
### RESULT:
> read.csv2("example.utf", fileEncoding="UTF-8")
VARIABLE LABEL ORDER_IN_PROFILE
1 A Umlauts:??? 45
2 B Umlauts:???? 35
>
#####################################################################
The exact same command executed under R-2.14.0 (running under Windows
7) gives a...
2017 Apr 30
0
Any progress on write.csv fileEncoding for UTF-16 and UTF-32 ?
...me, that means dealing with Windows-1252 and UTF-8 encoding, with UTF-16
> and UTF-32 as helpful curiosities.
>
> Something as simple as iconv ("\n", to = "UTF-16") causes an error, due to
> an embedded nul.
>
> Then there is write.csv (or write.table) with its fileEncoding parameter:
> not working correctly for UTF-16 and UTF-32.
>
> Of course, developers are aware of this, for example ?
>
> [Rd] iconv to UTF-16 encoding produces error due to embedded nulls
> (write.table with fileEncoding param)
> https://stat.ethz.ch/pipermail/r-devel/2016-Febr...
2017 May 01
3
Any progress on write.csv fileEncoding for UTF-16 and UTF-32 ?
...ith Windows-1252 and UTF-8 encoding, with UTF-16
>> and UTF-32 as helpful curiosities.
>>
>> Something as simple as iconv ("\n", to = "UTF-16") causes an error, due to
>> an embedded nul.
>>
>> Then there is write.csv (or write.table) with its fileEncoding parameter:
>> not working correctly for UTF-16 and UTF-32.
>>
>> Of course, developers are aware of this, for example ?
>>
>> [Rd] iconv to UTF-16 encoding produces error due to embedded nulls
>> (write.table with fileEncoding param)
>> https://stat.ethz.ch...
2017 May 02
0
Any progress on write.csv fileEncoding for UTF-16 and UTF-32 ?
...-16LE", "UTF-16BE", "UTF-16",
"UTF-32LE", "UTF-32BE", "UTF-32"
)
df <- data.frame (x = 1:2, y = 3:4)
csv <- structure (lapply (ENCODING, function (encoding) {
csv <- sprintf ("df_%s.csv", encoding)
write.csv (df, csv, fileEncoding = encoding, row.names = FALSE)
list (default.eol = list (
csv = csv, raw = readBin (csv, "raw", 1000))
)
}), .Names = ENCODING)
EOL <- c (LF = "\n", CR = "\r", "CR+LF" = "\r\n")
CSV <- structure (lapply (ENCODING, function (encoding)...
2016 Feb 24
0
iconv to UTF-16 encoding produces error due to embedded nulls (write.table with fileEncoding param)
...I execute the code from the "?write.table" examples section
>>> >>
>>> >> x <- data.frame(a = I("a \" quote"), b = pi)
>>> >> # (ommited code)
>>> >> write.csv(x, file = "foo.csv", fileEncoding = "UTF-16LE")
>>> >>
>>> >> the resulting CSV file has a size of 6 bytes which is too short
>>> >> (truncated):
>>> >>
>>> >> """,3
>>>
>>> reproducibly, ye...
2011 Jun 01
1
read.csv and FileEncoding in Windows version of R 2.13.0
...vel List:
read.csv() seems to have changed in R version 2.13.0 as compared to version 2.12.2 when reading in simple CSV files.
Suppose I read in a 2-column CSV file ("test.csv"), say
1, a
2, b
If file is encoded as UTF-8 (on Windows 7), then under R 2.13.0
read.csv("test.csv",fileEncoding="UTF-8",header=FALSE) yields the following output
V1
1 ?
Warning messages:
1: In read.table(file = file, header = header, sep = sep, quote = quote, :
invalid input found on input connection 'test.csv'
2: In read.table(file = file, header = header, sep = sep, quote = quote,...
2016 Feb 23
0
iconv to UTF-16 encoding produces error due to embedded nulls (write.table with fileEncoding param)
...>>
> >> If I execute the code from the "?write.table" examples section
> >>
> >> x <- data.frame(a = I("a \" quote"), b = pi)
> >> # (ommited code)
> >> write.csv(x, file = "foo.csv", fileEncoding = "UTF-16LE")
> >>
> >> the resulting CSV file has a size of 6 bytes which is too short
> >> (truncated):
> >>
> >> """,3
>
> reproducibly, yes.
> If you look at what write.csv does
> and then s...
2016 Feb 23
4
iconv to UTF-16 encoding produces error due to embedded nulls (write.table with fileEncoding param)
...m.de wrote:
>>
>>
>> If I execute the code from the "?write.table" examples section
>>
>> x <- data.frame(a = I("a \" quote"), b = pi)
>> # (ommited code)
>> write.csv(x, file = "foo.csv", fileEncoding = "UTF-16LE")
>>
>> the resulting CSV file has a size of 6 bytes which is too short
>> (truncated):
>>
>> """,3
reproducibly, yes.
If you look at what write.csv does
and then simplify, you can get a similar wrong result b...
2016 Feb 24
2
iconv to UTF-16 encoding produces error due to embedded nulls (write.table with fileEncoding param)
...>> If I execute the code from the "?write.table" examples section
>> >>
>> >> x <- data.frame(a = I("a \" quote"), b = pi)
>> >> # (ommited code)
>> >> write.csv(x, file = "foo.csv", fileEncoding = "UTF-16LE")
>> >>
>> >> the resulting CSV file has a size of 6 bytes which is too short
>> >> (truncated):
>> >>
>> >> """,3
>>
>> reproducibly, yes.
>> If you look at w...
2016 Feb 16
2
iconv to UTF-16 encoding produces error due to embedded nulls (write.table with fileEncoding param)
If I execute the code from the "?write.table" examples section
x <- data.frame(a = I("a \" quote"), b = pi)
# (ommited code)
write.csv(x, file = "foo.csv", fileEncoding = "UTF-16LE")
the resulting CSV file has a size of 6 bytes which is too short
(truncated):
""",3
The problem seems to be the iconv function:
iconv("foo", to="UTF-16")
produces
Error in iconv("foo", to = "UTF-16"):
embedd...
2016 Feb 23
1
iconv to UTF-16 encoding produces error due to embedded nulls (write.table with fileEncoding param)
...>> If I execute the code from the "?write.table" examples section
> > >>
> > >> x <- data.frame(a = I("a \" quote"), b = pi)
> > >> # (ommited code)
> > >> write.csv(x, file = "foo.csv", fileEncoding = "UTF-16LE")
> > >>
> > >> the resulting CSV file has a size of 6 bytes which is too short
> > >> (truncated):
> > >>
> > >> """,3
> >
> > reproducibly, yes.
> > If you loo...
2016 Feb 24
0
iconv to UTF-16 encoding produces error due to embedded nulls (write.table with fileEncoding param)
...e.table" examples section
>>>>> >>
>>>>> >> x <- data.frame(a = I("a \" quote"), b = pi)
>>>>> >> # (ommited code)
>>>>> >> write.csv(x, file = "foo.csv", fileEncoding = "UTF-16LE")
>>>>> >>
>>>>> >> the resulting CSV file has a size of 6 bytes which is too short
>>>>> >> (truncated):
>>>>> >>
>>>>> >> ""&...
2016 Feb 25
0
iconv to UTF-16 encoding produces error due to embedded nulls (write.table with fileEncoding param)
...If I execute the code from the "?write.table" examples section
>>> >>
>>> >> x <- data.frame(a = I("a \" quote"), b = pi)
>>> >> # (ommited code)
>>> >> write.csv(x, file = "foo.csv", fileEncoding = "UTF-16LE")
>>> >>
>>> >> the resulting CSV file has a size of 6 bytes which is too short
>>> >> (truncated):
>>> >>
>>> >> """,3
>>>
>>> reproducibly, yes....
2017 May 02
1
Any progress on write.csv fileEncoding for UTF-16 and UTF-32 ?
...ot;UTF-16",
> "UTF-32LE", "UTF-32BE", "UTF-32"
> )
>
> df <- data.frame (x = 1:2, y = 3:4)
>
> csv <- structure (lapply (ENCODING, function (encoding) {
> csv <- sprintf ("df_%s.csv", encoding)
> write.csv (df, csv, fileEncoding = encoding, row.names = FALSE)
> list (default.eol = list (
> csv = csv, raw = readBin (csv, "raw", 1000))
> )
> }), .Names = ENCODING)
>
> EOL <- c (LF = "\n", CR = "\r", "CR+LF" = "\r\n")
>
> CSV <- structure...
2016 Feb 25
2
iconv to UTF-16 encoding produces error due to embedded nulls (write.table with fileEncoding param)
...gt; >> If I execute the code from the "?write.table" examples section
>> >>
>> >> x <- data.frame(a = I("a \" quote"), b = pi)
>> >> # (ommited code)
>> >> write.csv(x, file = "foo.csv", fileEncoding = "UTF-16LE")
>> >>
>> >> the resulting CSV file has a size of 6 bytes which is too short
>> >> (truncated):
>> >>
>> >> """,3
>>
>> reproducibly, yes.
>> If you look at what...
2020 Oct 20
2
write.csv covert Åland to <c5>land
On 2020/10/20 17:23, Dr Eberhard W Lisse wrote:
> ?file.write()
>
> look for fileEncoding?
>
> el
>
There is no file.write(). I have tried fileEncoding = "utf8" and
"latin1" in write.csv(). However, it does not have effect. The output is
is <U+00C5>land or <c5>land.
Best,
Jinsong
> On 20/10/2020 11:13, Jinsong Zhao wrote:
>> Hi th...
2016 Feb 22
0
iconv to UTF-16 encoding produces error due to embedded nulls (write.table with fileEncoding param)
...ue, 2016-02-16 at 18:25 +0100, nospam at altfeld-im.de wrote:
>
>
> If I execute the code from the "?write.table" examples section
>
> x <- data.frame(a = I("a \" quote"), b = pi)
> # (ommited code)
> write.csv(x, file = "foo.csv", fileEncoding = "UTF-16LE")
>
> the resulting CSV file has a size of 6 bytes which is too short
> (truncated):
>
> """,3
>
> The problem seems to be the iconv function:
>
> iconv("foo", to="UTF-16")
>
> produces
>
> E...
2010 Dec 17
1
Help for loop
Hello all,
Is there any way to get each file from a website list and aggregate in a
data frame?
Otherwise I have to type 23 thousand web address into a long script like it:
base1 <- read.table("site 1", sep=";", header=T,
fileEncoding="windows-1252")
base2 <- read.table("site 2", sep=";", header=T,
fileEncoding="windows-1252")
I need to download each .CSV file from each address in the list vector and
row bind all them into a big data frame.
Also I need to decode each object to UTF-8....