1
In theory, any. txt file can be imported into the R
. Try to rotate the command
dados <- read.table(file="NomeDoArquivo.txt", header=TRUE, sep="\t")
in which
file="NomeDoArquivo.txt"
is the file name to be importedheader=TRUE
informs thatNomeDoArquivo.txt
has a header. IfNomeDoArquivo.txt
does not have header, change the argument toheader=FALSE
sep="\t"
is the column separator of the file. Howread.csv
is not working, I guess the column separator is a tab tag. Other common options forsep
sane,
,;
and" "
(space).
Finally, turn
dim(dados)
str(dados)
and see if the number of rows and columns reported is as expected and if the data type in each column is correct. If all goes well, the data set has been imported correctly. If it doesn’t work (or if the above code doesn’t work), come back here and we’ll try to figure out what to do together.
Thanks Marcus Nunes, I had already tried with the read.csv, the problem is that from a point, as here: [{id:14974258949854043,Component:datepicker,index:0,label:Veuillez ele le:
– Elias Carvalho
I’m sorry, but I didn’t understand if my suggestion solved the problem.
– Marcus Nunes
The suggestion Marcus gave was a path, and I would even suggest that if not, try the function
read.fwf
. Only after your comment read a field as a variable only I started to question what would be the variables of your problem. Theread.txt
or similar will understand each column of the figure as a variable. If your problem is that the variables are only in the part of[{id:14974258949854043,component:datePicker,index:0,label:Veuillez
then it would be another way to solve your problem.– Rafael Cunha
Thanks Rafael Cunha, the problem is exactly figure out which one to read this, in fact it starts with numbers, then comes the bracket and the keys and it seems that there is a label separated by ':' of the value, but I’m not sure yet: 001115,9156BFA5-4A4B-4028-9F13-769DECDC01D8,Questionnaire,2017-06-21 08:36:49,000,2017-06-21 12:00:00,000,1,"[{""id"":""14974258949854043"",
– Elias Carvalho
Hi Marcos Nunes, did not solve, she reads the file but does not separate the fields, see my last comment
– Elias Carvalho
So the situation is much more complicated. What should be the result of reading the field
[{id:14974258949854043,component:datePicker,index:0,label:Veuillez
? What does this mean? How many different columns? Would four be (id
,component
,index
andlabel
)?– Marcus Nunes