Re: [R] Read Unicode text (*.txt)

2019-07-02 Thread William Dunlap via R-help
Try changing encoding="UTF-16" to fileEncoding="UTF-16". Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Jul 1, 2019 at 9:30 PM javad bayat wrote: > Dear all; > I use your suggestion but I gave the same warning messages. I changed the > file name (Data.csv). > " > d4<-read.csv("./Data.csv

Re: [R] Read Unicode text (*.txt)

2019-07-02 Thread Olivier Crouzet
Hi Javad, I could not make sense of the data structure associated with the csv file as it is copied in your previous message. Would you mind sending a link so one can download your csv file directly (or at least the first few lines) so people can check the exact properties of your file? Yours. Ol

Re: [R] Read Unicode text (*.txt)

2019-07-01 Thread javad bayat
Dear all; I use your suggestion but I gave the same warning messages. I changed the file name (Data.csv). " d4<-read.csv("./Data.csv",sep=";",header=TRUE,encoding="UTF-16") Warning messages: 1: In read.table(file = file, header = header, sep = sep, quote = quote, : line 1

Re: [R] Read Unicode text (*.txt)

2019-07-01 Thread William Dunlap via R-help
If I recall correctly, Excel's 'Unicode' used to mean "UTF-16", which R's scan() did not recognize without a hint. The relevant argument is fileEncoding, not encoding. UTF-16 files generally have lots of null bytes and UTF-8 files have no null bytes and if you try to read UTF-16 as UTF-8 you get

Re: [R] Read Unicode text (*.txt)

2019-07-01 Thread Abby Spurdle
> Don't be so US-centric, Abby... how do you know that javad's version of Excel doesn't default to using semicolons? I don't. However, Comma-Separated Values (CSV) are, comma separated, by definition. So, if the files use semicolons, then... Also, the use of the wrong sep="my.delim" argument is

Re: [R] Read Unicode text (*.txt)

2019-07-01 Thread Jeff Newmiller
Don't be so US-centric, Abby... how do you know that javad's version of Excel doesn't default to using semicolons? ?read.csv2 On July 1, 2019 6:06:32 PM PDT, Abby Spurdle wrote: >> I am trying to read an excel CSV file (1.csv). When I read it as csv >file >> in R, the R shows me the exact numbe

Re: [R] Read Unicode text (*.txt)

2019-07-01 Thread Abby Spurdle
> I am trying to read an excel CSV file (1.csv). When I read it as csv file > in R, the R shows me the exact number of row. But it puts all columns in > one column, while I have 3 or 4 columns in the data frame. > d4 = read.table("./4.csv",sep=";",header=TRUE) Firstly, I recommend against naming y

Re: [R] Read Unicode text (*.txt)

2019-07-01 Thread Jim Lemon
Yep, you're right. Jim On Tue, Jul 2, 2019 at 7:52 AM William Dunlap wrote: > > Should that encoding="UTF-8" be encoding="UTF-16"? > > Bill Dunlap > TIBCO Software > wdunlap tibco.com > > > On Mon, Jul 1, 2019 at 2:45 PM Jim Lemon wrote: >> >> Hi Javad, >> Unicode characters do have embedded

Re: [R] Read Unicode text (*.txt)

2019-07-01 Thread William Dunlap via R-help
Should that encoding="UTF-8" be encoding="UTF-16"? Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Jul 1, 2019 at 2:45 PM Jim Lemon wrote: > Hi Javad, > Unicode characters do have embedded nulls. Try this: > > d4<-read.table("./4.csv",sep=";",header=TRUE,encoding="UTF-8") > > Jim > > O

Re: [R] Read Unicode text (*.txt)

2019-07-01 Thread Jim Lemon
Hi Javad, Unicode characters do have embedded nulls. Try this: d4<-read.table("./4.csv",sep=";",header=TRUE,encoding="UTF-8") Jim On Tue, Jul 2, 2019 at 3:47 AM javad bayat wrote: > > Dear R users; > I am trying to read an excel CSV file (1.csv). When I read it as csv file > in R, the R shows m

[R] Read Unicode text (*.txt)

2019-07-01 Thread javad bayat
Dear R users; I am trying to read an excel CSV file (1.csv). When I read it as csv file in R, the R shows me the exact number of row. But it puts all columns in one column, while I have 3 or 4 columns in the data frame. " d4 = read.table("./4.csv",sep=";",header=TRUE) Warning messages: 1: