I have a csv uploaded to posit cloud and when i want to view the info inside it this is what it's inside:
996 995;1;7/5/2010;0;72.0;39104.1;72.55;2.835;0.0;0.0;0.0;0.0;0.0;2.103.399.684;7.808;3;151315
997 996;1;7/5/2010;0;58.0;4608.0;72.55;2.835;0.0;0.0;0.0;0.0;0.0;2.103.399.684;7.808;3;151315
998 997;1;7/5/2010;0;7.0;20457.62;72.55;2.835;0.0;0.0;0.0;0.0;0.0;2.103.399.684;7.808;3;151315
I have trouble with working with this dataframe and I think that the problem is that the separator is ; and not tab. How can I change this?
When I want to see what's inside a column in this dataframe:
dataset$Weekly_Sales --> NULL
Thanks!
Related
Want to loop through a comma separated text file.
For ex:
mytext <- 3,24,25,276,2,87678,20-07-2022,1,5
From this mytext I would like to loop through like below :
for (i in 1:length(mytext)) {
print(mytext[[i]])
}
I need to display like
3
24
25
276
2
87678
20-07.2021
1
5
Actually I need to set every value as an individual variable, like :
variable1:3
variable2:24
variable3:25
variable4:276
variable5:2
variable6:87678
variable7:20-07.2021
variable8:1
variable9:5
(my project is retrieve data from text file and then having database validations in R before entering records to database.)
Could anyone help me out? Thanks in advance.
Split your string:
strsplit(mytext, ",")[[1]]
I was exporting a database table for 397 records using TeraData FastExport utility. The exported CSV file, when opened in Excel shows the correct record count as 398 (including a header). But in unix by using wc -l command the record count shows as 405 instead of 398. Even in Notepad++ the record count is 405.
I'm unable to figure out what might be causing this problem. Why would the record count of a csv file different between text editors and Excel?
Any ideas?
In CSV you can have line breaks as part of a "value/cell", using quotes to clarify that's a value and not the start of a new row .
In this case, the Excel would consider just a "cell" and it won't increase the number of Excel rows, while a text editor would recognize the line break and count it.
Calling all RDLC expert out there.
When displaying the values of the parameter(which the values is in array) to a tablix or table, it only displays the first value data of the array.
Which looks like this.
I want to display the 626 datas of the array to be displayed individually in rows.
There are about 626 datas inside the array named Testparameter, but it seems to that it only displays the first value of the array.
Maybe I must be missing something in the expression in reproducing the values.
This is the expression that I am using
=Parameters!Testparameter.Value
I have also tried JOIN expression but it displays all the 626 datas inside the column.
=Join(Parameters!Testparameter.Value,", ")
Whic resulted to this.
Any ideas what I am doing wrong? or is this possible?
Thank you in advance.
It seems that the dates returned from the parameter have an enter (\n) or some spaces, what you can try is to replace all the string \n or spaces to empty string and check.
With the DB tool sqsh, I want to get the column names and the data tab delimited.
The bcp option does not include the column names.
The csv option includes the column names, but uses comma as the separate (doh). Is there a way to change it?
Currently looking to post-process the file to change the commas to tabs (ignoring the commas within strings...).
You can \set colsep="\t" to change the separator for the standard output to tab.
Edit: \t didn’t work (in my cygwin), so I used <CTRL-V><TAB>. That works:
[228] > \set colsep=" " -- Hit CTRL-V then <TAB> here.
[229] > select 'ABC' as STRING, 12 as INT;
STRING INT
------ -----------
ABC 12
(1 row affected)
Please note that since sqsh version 2.5 it is now possible to assign control characters to some variables like colsep, linesep, bcp_colsep and bcp_rowsep. So the
\set colsep="\t"
should work now properly with sqsh-2.5.
I have one loop
for (chr in paste('chr',c(seq(1,22),'X','Y'),sep='')){
.
.
write.table(exp,file="list.txt",col.names =FALSE,row.names=TRUE,sep="\t")
}
right now the loop will give me only one txt with the data from the last loop (chromosome Y)
What i want is one txt file with the data from all the chromosomes/ from all the loops. Not 24 different txt (one per chromosome)
Thank you
Best regards
Anna
What you are not yet recognizing is that 'append' is set to FALSE by default and that you need to explicitly change it to TRUE if you want to record each 'exp'-object (which by the way is an unfortunate name for a data object because it's shared by a common math function). If you set append=TRUE and if the "exp"-object is a full record of one chromosome at each time the write.csv is called (hopefully with an 'chr'-identifier column so you can keep track of where the data came from), then you should succeed.