similar to: read.csv quotes within fields

Displaying 20 results from an estimated 40000 matches similar to: "read.csv quotes within fields"

2010 Apr 08
1
Strange csv parsing problem
> url <- "http://dl.dropbox.com/u/41902/22240.csv" > > read.csv(url)[, 1] [1] "oppose" NA "oppose" "support" > read.csv(url, header = F)[, 1] [1] "url" [2] "http://maplight.org/us-congress/bill/109-hr-5825/387248" [3] "http://maplight.org/us-congress/bill/110-hr-3546/378743" [4]
2009 Jun 13
3
How Can I insert another column data into the CSV file when I use FasterCSV?
Hi, All, Suppose I have a CSV file, there is data in it. * Column 1 Column2 Column 3 Column 4 Row1 a b c Row2 a2 b2 c2* You know, the column 4 is no data Now, I would like to insert data to Column 4, after save, the CSV file will be: * Column 1
2017 Sep 19
3
what do you think about write.table(... qmethod = "excel")?
Last week one of our clients reported trouble with a csv file I generated with write.table. He said that columns with quotes for character variables were rejected by their data importer, which was revised to match the way Microsoft Excel uses quotation marks in character variables. I explained to them that quoted character variables are virtuous and wise, of course, but they say Microsoft Excel
2012 Mar 26
2
read.csv and field containing single quotes
I need to read in csv files, created by 3rd party, with fields containing single quotes (as shown below). "header1","header2","header3","header4" "field1r1","field2r1","field3r1","field4r1" "field1r2","field2r2","field3r2PartA), field3r2PartB Very" Long","field4r2"
2011 Oct 06
1
Issue with read.csv treatment of numerics enclosed in quotes (and a confession)
Dear Help-Rs,   I've been dealing with this problem for some time, using a work-around to deal with it. It's time for me to come clean with my ineptitude and seek a what has got to be a more streamlined solution from the Help-Rverse.   I regularly import delimited text data that contains numerics enclosed in quotes (e.g., "00765288071").  Thing is, for some of these data, I need
2024 Apr 10
1
Exceptional slowness with read.csv
That's basically what I did 1. Get text lines using readLines 2. use tryCatch to parse each line using read.csv(text=...) 3. in the catch, use?gregexpr to find any quotes not adjacent to a comma (gregexpr("[^,]\"[^,]",...) 4. escape any quotes found by adding a second quote (using str_sub from stringr) 6. parse the patched text using read.csv(text=...) 7. write out the parsed
2012 Aug 03
3
embedding data frame in R code?
I would like to insert a few modest size data frames directly into my R code. a short illustration example of what I want is d <- read.csv( _END_, row.names=1 ) , "col1", "col2" "row1",1,2 "row2",3,4 __END__ right now, the data sits in external files. I could put each column into its own vector and then combine into a data frame, but this seems
2008 Aug 20
1
read.csv : double quoted numbers
Hello; I am new user of R; so pardon me. I am reading a .txt file that has around 50+ numeric columns with '\t' as separator. I am using read.csv function along with colClasses but that fails to recognize double quoted numeric values. (My numeric values are something like "1,001.23"; "1,008,000.456".) Basically read.csv fails with - "scan() expected 'a
2003 Sep 12
1
Getting 2 kinds of quotes inside a pasted string
Hi, all. I would like to use "pipe" to run a file through an awk program before scanning (to reduce the amount of data I'll be taking in). I would like to construct the awk program in R, and also to be able to set the awk variable FS, to accommodate different field separators in different files. My problem is that I keep getting the quotes escaped in the string that comes out, and
2010 May 05
3
Read data from .csv file as a matrix
Hi R-users, I have a csv file that contains weather observation (rows) by days (in columns). I open using: > temp = read.csv("Weather.csv", sep=",") and read: X X1.Jan X2.Jan X3.Jan X4.Jan 1 Min 2 3 4 1 2 Max 6 10 8 6 3 Forecast Min 3 1 1 3 4 Forecast Max 8 7
2010 May 31
2
accessing a data frame with row names
Readers, I have entered a file into r: ,column1,column2 row1,0.1,0.2 row2,0.3,0.4 using the command: dataframe<-read.table("/path/to/file.csv",header=T,row.names=1) When I try the command: dataframe[,2] I receive the response: NULL I was expecting: row1 0.2 row2 0.4 What is my error with the syntax please? Yours, r251 mandriva2009
2012 May 24
1
quotes in Rscript -e through system
I figured out how to use quotes and parentheses when using Rscript -e (on a bash shell): Rscript -e write\(1,\"a.txt\"\) --> Question 1: why do the parentheses need to be escaped in the shell? (More a shell than an R question) Then I figured out how to use quotes and parentheses when calling Rscript through system: system('Rscript -e write\\(1,\\\'a.txt\\\'\\)')
2012 Dec 04
2
access.log: double quotes not escaped
Hello! I have seen that if an User Agent has double quotes in it will not be escaped when printed to access.log: > 192.168.0.2 - - [03/Dec/2012:20:45:54 +0100] "GET /stu HTTP/1.0" 200 313978 "-" "Che"atin" 15 I saw the code and there is not code to address this. -- xOneca_,,_
2024 Apr 10
2
Exceptional slowness with read.csv
?s 06:47 de 08/04/2024, Dave Dixon escreveu: > Greetings, > > I have a csv file of 76 fields and about 4 million records. I know that > some of the records have errors - unmatched quotes, specifically. > Reading the file with readLines and parsing the lines with read.csv(text > = ...) is really slow. I know that the first 2459465 records are good. > So I try this: >
2009 Sep 25
2
Data import from .csv-file with numeric header
Hello everybody out there using R, How can I import data with a numeric header from a .csv-file? My file example.csv has the following content (a duplicate measurement of potentials for three different currents): 1; 2; 6 1.0; 2.1; 5.9 1.1; 2.0; 6.0 I try to import the data by using: >measurement <- read.table("example.csv",sep=";",header=T) However, the values in the
2006 Jan 21
4
Single quotes in parameters
I have a "search" action for my "projects" controller, which defines a set of projects as follows @projects = Project.find(:all, :include => [:user,:clients], :conditions => "name like ''%" + params[:query] + "%''",:order => ''number'') This works fine, until I type an entry into my search box that has a single
2004 Aug 18
1
header line generated write.table
I want to write following data frame into a CSV file: Col1 Col2 Col3 Row1 1 1 1 Row2 2 2 2 where Row1, Row2 are the row names and Col1, Col2, Col3 are the column names. The correct CSV file should be: ,"Col1","Col2","Col3" Row1,1,1,1 Row2,2,2,2 However, the one generated by R using write.table(x, file="xyz.csv",
2011 Dec 13
2
how to manually enter an double quote as data feed?
I'm doing a text mining project where I have to manually enter a double quote as an element inside a vector. I tried char[10]='"'#where i enclosed the double quote in a pair of single quotes. But the result is [1] "\"". Somehow a back slash is added automatically. I also tried to enclose the double quote in a pair of double quotes. That didn't work either.
2017 May 02
2
Issue with parsing of forwarded messages with attachments and quotes in the subject
Hi all, at work we use Roundcube acting as a mail client for the Dovecot Imap server. In Roundube the messages are parsed through the Imap BODYSTRUCTURE command If a message contains forwarded messages and attachments and some of the messages contains a quote (") in the subject, then the resulting BODYSTRUCTURE appears to be malformed. --- After some digging through the code of
2011 Aug 03
2
Malformed CSV Error
Hello, I am getting error :- #<CSV::MalformedCSVError: Unclosed quoted field on line 1892.>. I have following code :- -------------------------------------------------- @parsed_file = CSV.open("#{RAILS_ROOT}/private/sales_report_files/#{@file_folder}/#{@sub_file_folder}/#{@file_name.filename}",''r'',:col_sep =>?\t) @parsed_file.each_with_index do |row, index|