import-from-csv

Import gzipped data into Google Sheets

杀马特。学长 韩版系。学妹 提交于 2019-11-30 10:06:32
I am trying to fetch a gzip from a URL and import it automatically into a Google Sheets. The gzip contains one file of CSV data. I know I can import the CSV data into a Google Sheets but I would like to be able to cut out the step of me having to download the gzip and extract the file first before uploading it into a Google Sheets. So my queries: Is it possible to import a gzipped CSV file from a URL directly into a Google Sheets? If not, how would this be done with a Google Apps Script? There is an undocumented utility in GAS called unzip, I know it can unzip ordinary .zip files but have no

Import large csv file to mysql database using php

对着背影说爱祢 提交于 2019-11-30 07:23:54
I have a very large CSV file (150 MB). What is the best way to import it to MySQL? I have to do some manipulation in PHP before inserting it into the MySQL table. You could take a look at LOAD DATA INFILE in MySQL. You might be able to do the manipulations once the data is loaded into MySQL, rather than first reading it into PHP. First store the raw data in a temporary table using LOAD DATA INFILE, then transform the data to the target table using a statement like the following: INSERT INTO targettable (x, y, z) SELECT foo(x), bar(y), z FROM temptable I would just open it with fopen and use

How to import a tsv file with SQLite3

╄→尐↘猪︶ㄣ 提交于 2019-11-30 06:24:41
问题 I have a tsv (tab separated file) that I would like to import with sqlite3. Does someone know a clear way to do it? I have installed sqlite3, but not created any database or tables yet. I've tried the command .import /path/filename.tsv my_new_table but it gives me the error: no such table: my_new_table. However, from what I'd read it should create the table automatically if it does't exist. Does it mean I need to create and use a database first, or is there another trick to importing a .tsv

How can I import a CSV file via a rake task?

徘徊边缘 提交于 2019-11-30 04:44:35
I know this question has been asked a lot on this forum but I'm under a strict deadline and I need some help, so any advice is much appreciated. I'm new to Ruby on Rails so please keep that in mind when responding. I want to create a rake task that, when run, updates multiple tables in mysqlite db. This is a migration file that creates a new incident in my db. How do I create a rake task that will input all this info via a CSV file. Can someone PLEASE give me some help in writing the rake file from start to finish. Obviously you don't need to write every task for every string, just give me a

Data Manipulation in R: 'X' must be atomic

心不动则不痛 提交于 2019-11-29 08:00:27
I have imported a file with headings and numbers in multiple columns using the following command. irs_data <- read.csv(file="10incyallnoagi.csv") I would like to divide the values in 1 column by another and then determine the highest 3 values. salary_var <- c(irs_data[13]/irs_data[12]) head(sort(new_var, decreasing=TRUE), 3) I keep getting the constant error. As a beginner to R , what does it mean "x must be atomic" in this context. Error in sort.int(x, na.last = na.last, decreasing = decreasing, ...) : 'x' must be atomic The problem is that salary_var is a list containing a single-element.

How can I import a CSV file via a rake task?

此生再无相见时 提交于 2019-11-29 02:39:02
问题 I know this question has been asked a lot on this forum but I'm under a strict deadline and I need some help, so any advice is much appreciated. I'm new to Ruby on Rails so please keep that in mind when responding. I want to create a rake task that, when run, updates multiple tables in mysqlite db. This is a migration file that creates a new incident in my db. How do I create a rake task that will input all this info via a CSV file. Can someone PLEASE give me some help in writing the rake

Importing data from .csv using d3.js

a 夏天 提交于 2019-11-28 19:26:22
I am trying to import some data from a .csv using d3.js. I am having trouble doing this, and was wondering if anyone could lend a hand. My .csv file is formatted like so: max_i,min_i,max_f,min_f -122.1430195,-122.1430195,-122.415278,37.778643 -122.1430195,-122.1430195,-122.40815,37.785034 -122.4194155,-122.4194155,-122.4330827,37.7851673 -122.4194155,-122.4194155,-122.4330827,37.7851673 -118.4911912,-118.4911912,-118.3672828,33.9164666 -121.8374777,-121.8374777,-121.8498415,39.7241178 -115.172816,-115.172816,-115.078011,36.1586877 -82.5618186,-82.5618186,-79.2274115,37.9308282 -79.9958864,-79

Cannot import data from csv file in d3

寵の児 提交于 2019-11-27 23:04:00
I'm just learning d3, and I'm attempting to import data from a CSV file, but I keep getting the error "XMLHttpRequest cannot load file:///Users/Laura/Desktop/SampleECG.csv. Cross origin requests are only supported for HTTP. ". I've searched for how to fix this error and have ran it on a local web server, but I haven't found a solution that works for d3.v2.js. Here's a sample of the code: var Time = [] ECG1 = [] d3.csv("/Desktop/d3Project/Sample.csv", function(data) { Time = data.map(function(d) {return [+d["Time"]];}); ECG1 = data.map(function(d) {return [+d["ECG1"]];}); console.log(Time)

Data Manipulation in R: 'X' must be atomic

谁说胖子不能爱 提交于 2019-11-27 18:52:54
问题 I have imported a file with headings and numbers in multiple columns using the following command. irs_data <- read.csv(file="10incyallnoagi.csv") I would like to divide the values in 1 column by another and then determine the highest 3 values. salary_var <- c(irs_data[13]/irs_data[12]) head(sort(new_var, decreasing=TRUE), 3) I keep getting the constant error. As a beginner to R , what does it mean "x must be atomic" in this context. Error in sort.int(x, na.last = na.last, decreasing =

Read a small random sample from a big CSV file into a Python data frame

扶醉桌前 提交于 2019-11-27 03:37:54
The CSV file that I want to read does not fit into main memory. How can I read a few (~10K) random lines of it and do some simple statistics on the selected data frame? Assuming no header in the CSV file: import pandas import random n = 1000000 #number of records in file s = 10000 #desired sample size filename = "data.txt" skip = sorted(random.sample(xrange(n),n-s)) df = pandas.read_csv(filename, skiprows=skip) would be better if read_csv had a keeprows, or if skiprows took a callback func instead of a list. With header and unknown file length: import pandas import random filename = "data.txt"