Yea, that worked. Thank you. :)
From: jim holtman
Sent: Wednesday, February 28, 2024 12:52 PM
To: Ebert,Timothy Aaron
Cc: r-help@r-project.org
Subject: Re: [R] Trouble reading a UTF-16LE file
[External Email]
Try this:
> x <- file("C:\\Users\\Jim\\Downloads\\PV2-ch2 -
Try this:
> x <- file("C:\\Users\\Jim\\Downloads\\PV2-ch2 - R_Help.ANA",+
> encoding = "UTF-16")> y <- readLines(x)> head(y)[1] "1\t36,74\t0"
> "2\t269,02\t-44" "1\t326,62\t29""2\t354,52\t24"
[5] "8\t390,75\t1838" "2\t395,11\t-1053">
>
Thanks
Jim Holtman
*Data Munger
The earlier post had an attached text file that did not go through.
I hope this link works. I tested it with a coworker, but that is no guarantee.
https://uflorida-my.sharepoint.com/:u:/g/personal/tebert_ufl_edu/EXf5u_CtTwJCrhdfTBIPr7wBefZHx4P_suj4wAWb8i8HFA?e=iQawhh
Regards,
Tim
Dear R-help,
I am having trouble reading a UTF-16LE formatted file. The issue appears to
be a byte order mark at the beginning of the file. I have tried readLines(file,
encoding='utf-16LE') but that got me
[1]"\xff\xfe1" "" "" "" "" ""
This is a tab delimited text
When you specify LE you are overriding any useful information that the BOM
could convey... see
https://softwareengineering.stackexchange.com/questions/370088/is-the-bom-optional-for-utf-16-and-utf-32.
?Encoding
On February 28, 2024 5:44:49 AM PST, "Ebert,Timothy Aaron"
wrote:
>Dear R-help,
>
В Wed, 28 Feb 2024 13:44:49 +
"Ebert,Timothy Aaron" пишет:
> readLines(file, encoding='utf-16LE')
There are two ways you could encounter an encoding in R.
First are encoding markers placed on every string object, which declare
the string to be encoded in UTF-8, Latin-1, the native locale
Dear R-help,
I am having trouble reading a UTF-16LE formatted file. The issue appears to
be a byte order mark at the beginning of the file. I have tried readLines(file,
encoding='utf-16LE') but got me
[1]"\xff\xfe1" "" "" "" "" ""
Regards,
Tim
7 matches
Mail list logo