Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [csv]

Questions on how to import into, extract data from, or exchange data between databases in CSV format (plain text using commas to separate values).

0
votes
3answers
50 views

Extracting data from extremely large csv files [closed]

I have a 40gb csv file with over 60 million rows for data analysis. Each row has a unique identifier (some numbers). For example, the first row's unique identifier will repeat approximately 150,000 ...
0
votes
1answer
29 views

Copying CSV file into PostgreSQL database “Psycopg2.DataError: invalid input syntax for integer:” Data is a string / DB column schema is a string [closed]

It's my first post - please don't initially bark at me over this question being asked before...I've read those haha, but it didn't solve my dilemma. Also - I am not a developer or DB admin - I'm a ...
0
votes
0answers
9 views

RDDs, Maps and Apache Spark

I have been playing around with Apache Spark, firstly I learned PostgreSQL and I have a few queries that I needed to run on Spark. I managed to run them as SQL Strings in Spark SQL, but now I have to ...
0
votes
1answer
22 views

Best practices for storing multiple SQL tables per user (built from uploaded csv file?)

I have a few users who will be uploading a few types of predefined CSV files. I need to store these as sql tables to be able to run queries on this data for a particular user, however that means there'...
1
vote
0answers
9 views

Custom Export from power BI service

I'm trying to make a custom button that exports filtered tables to a csv and downloads them to my computer. I am aware that you can do this with the '...' button but this functionality is for other ...
0
votes
0answers
22 views

Can I force a LOAD DATA LOCAL statement to abort if an error is not loaded?

I am trying to load a CSV file into a MySQL table with the load data local statement. After loading it, the statement reports Query OK, 1030 rows affected, 7314 warnings (0.03 sec) Records: 1043 ...
0
votes
0answers
44 views

Writing CSV directly to a BYTEA column from PostgreSQL tables

Assuming these two tables: CREATE TABLE data (day DATE, kpi INTEGER); CREATE TABLE reports (csv BYTEA); Is it possible to (pseudocode): INSERT INTO reports (csv) (SELECT to_csv(SELECT day, kpi FROM ...
1
vote
1answer
21 views

InfluxDB batch insert only inserts the last line

I'm trying to insert some lines into a InfluxDB instance (running on Windows 7 x64) from both a .txt and a .csv file, but it's only inserting the last line on the file. I'm currently using the ...
0
votes
1answer
20 views

Load flat file into a predetermined table

Scenario Table created Data in flat file loaded to the table but with errors. please advise how to fix it (a) 'address' is split to 3 columns causing mismatch between the source and destination (b)...
-1
votes
1answer
97 views

How to normalize CSV invoice data?

For flat data which comes in with fields like: name address status class version user mode CSV files are regularly received, with the above as typical columns. ...
1
vote
2answers
91 views

MongoDB CSV Export: One Array/Column & Array Index on rows, or vice versa

I have a MongoDB schema that looks like this: const batchSchema = mongoose.Schema({ _id: mongoose.Schema.Types.ObjectId, time: {type: [Number]}, tmp: {type: [Number]}, hum: {type: [Number]}, ...
0
votes
1answer
30 views

csv engine and mysql start

my question is about speed when perform service mysql start. with many tables (some not often used). what engines consumes more or less start time ? example: innodb --> the more tables, the more ...
1
vote
1answer
49 views

\COPY not returning count psql

I am trying to copy CSV data into tables. Also I want to print the count. The command I'm using is: echo "begin; delete from a; \copy a from a.csv CSV HEADER; end;" | psql -hlocalhost -dpostgres -...
2
votes
2answers
145 views

Can't import flat file into SqlServer

I've got this tab-delimited flat file with fifty columns and two million rows. I am trying to import it into Sql Server 2017 Express. (I first tried working with it in Excel... hopeless.) I see two ...
0
votes
0answers
71 views

MySQL automatic import of (huge) csv files fails using mysqlimport

For testing purposes, I have to insert large Time Series data on a MySQL database, running on a Windows remote server. Firstly, the (very basic) table: CREATE TABLE 'sensor_data' ( '...
0
votes
0answers
24 views

mysql: make the server fail instead of just giving warnings

I have a mysql 5.7 server. I am trying to import some .csv files. Sometimes it may so happen that these are malformed. Here is a sample case: - 'mysql: [Warning] Using a password on the command ...
0
votes
2answers
569 views

postges: psql csv import fails although file exists

Trying to import a csv file as follows: psql -h 127.0.0.1 -d jira_statistics -U admin -p 5432 -c "COPY bugs FROM '/home/centos/bugs.csv' delimiter '|' csv;" Password for user admin: ERROR: could ...
0
votes
1answer
58 views

csv import fails without throwing an error

Ι am trying to import a csv file into an existing mysql 5.7 table. Here is the command (the db is in docker with bind mount for persistence) mysql -h 127.0.0.1 -uroot -prootpass --local_infile=1 ...
0
votes
2answers
986 views

foreach loop in sql scripts?

In powershell I use foreach to run a function through a list of targets. I was wondering that if there is any thing similar to foreach in sql, so I can run the same query through multiple DBs I chose ...
2
votes
0answers
41 views

How To Query Databases in Subject-Predicate Format?

I have csv data in this format: id fieldname fieldvalue -- --------- ---------- 1 fieldA A1 1 fieldB B1 2 fieldA A2 2 fieldA B2 If I upload this to MySQL, how can I ...
0
votes
2answers
341 views

Leading zeros are truncated when I spool to CSV

I have spooled a file to CSV using sqlplus. Everything works great but there is one issue. I have mobile numbers which start with 0, for example 04589 and 02586. After the spooling is complete, 0s ...
0
votes
1answer
74 views

listagg in order and including a sequence of separator when missing any row of a sequence

Sorry for the long title but it's a little bit difficult to explain. We have a table | N rows | Atrib1 | Atrib2 | Atrib3 | Atrib4 | Final row | --------------------------------------------------...
0
votes
2answers
200 views

SQL Server Agent - Do not show job step details and column headers in output file

I have a SQL Server Agent job which runs a select statement on a schedule and appends results to a CSV file (Right click the job --> properties --> advanced and then adding a file path to the output ...
1
vote
1answer
1k views

How to automate CSV-exports of queries in PL/SQL Developer (Oracle)?

I'm no pro in Oracle or PL/SQL Developer (I mostly use and admin mySQL and MS SQL Server). I'm not an admin of any sort, but have read access to many tables in Oracle via PL/SQL Developer. I need ...
5
votes
2answers
688 views

How to import CSV file in SQL server 2008?

I am trying to import a CSV file in SQL Server 2008. BULK INSERT is a way to go but it is applicable for CSV from SQL Server 2014 onwards. What would be an alternative way to achieve this goal? Any ...
-1
votes
1answer
212 views

Copy in SQL with index vs without index

Recently I have received a data dump in csv format that I am trying to import in my PSQL database. The dump consists of 8 csv file each of size 7GB. I have found that using the Copy command on one ...
2
votes
1answer
118 views

Handling variable fields in a CSV file with JSON?

Im trying to figure out the engineering to get a CSV file into PostgreSQL. Requirements: The CSV has X number of predetermined required fields The CSV file has Y number of dynamic fields Example: ...
0
votes
4answers
169 views

SSIS deployment failed - working with files

I've developed a simple SSIS package that will open a csv file, select a number of column, add two derived columns and then copy the results to a file. This works within visual studio (even if it ...
0
votes
1answer
950 views

Upload multiple csv file to multiple tables sqlServer

I have over than 200 csv files that each of them is diffrent table. I create now a new DB and want to upload them all so I will have all the table. I not accessable to old DB to backup in diffrent ...
-3
votes
1answer
298 views

Bulk Insert csv file error [closed]

I am trying to BULK INSERT a csv file to my SQL Server. Using code I found on this SO question, I ran: BULK INSERT Temp FROM 'c:\csv\student.csv ' WITH ( FIELDTERMINATOR = ',', ...
0
votes
0answers
47 views

Using psql, echo copy and import a pipe deliminated file

I'm writing a batch script, and batch doesn't like |, heck nor does command line entries. The only way I can input this command is to initiate a psql login directly and then issue it, which ruins the ...
1
vote
1answer
262 views

How to upload multiple csv files to sql server without constrains

I backed up an old SQL Server DB with .CSV files for each table. The old DB is now gone; the .CSV files are all I have. Now I want to create new DB and upload all those csv file (my old db removed) . ...
2
votes
1answer
67 views

How do I bulk load data and still provide row-by-row feedback?

We want to allow our users to import CSVs containing many thousands of records to "pre-load" a particular table in our system. It's not strictly a one-time operation, it may be performed multiple ...
2
votes
1answer
262 views

postgresql - Importing CSV Data with Custom Type

I'm mostly a newcomer to databases and am building a postgres database of student achievement in a series of courses. My database uses a type called "class" that consists of the course, the academic ...
2
votes
2answers
845 views

How to dump to csv valid json with Postgresql?

I am trying to dump some data as json with: \copy (SELECT json_build_object('areaSqft',area_sqft, 'titleNos',title_nos, 'buildingIds',building_ids, 'geometry',geom_json) FROM my_data) to my_data.csv ...
1
vote
2answers
126 views

How to split a string on every 2nd delimiter?

I have curves consisting of X/Y points (an array?) stored in a string with the same delimiter. There is 1 curve per row. Below is a simple example: 0,0,1,1,2,1.9,2.9,2.8,3.6,3.5 I want to extract ...
0
votes
1answer
337 views

Set columns dinamically in UTL_FILE

I've been stuck with this problem, so I'm looking for help now. I'm trying to get a .cvs file from a query with PL/SQL. I'm using a cursor and UTL_FILE to achieve that. The problem is that I have to ...
0
votes
1answer
313 views

Finding Columns causing errors in SQL Developer

I'm relatively new to Oracle SQL and trying to import CSVs using SQL Developer. I've been getting errors such as Insert failed for rows 1351 through 1400 ORA-01438: value larger than ...
0
votes
2answers
389 views

How to connect from local computer (mac) to remote Oracle DB and execute script and save results to CSV?

I can connect to remote Oracle DB using this signature: sqlplus 'user/pass@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=hostname.network)(Port=1521))(CONNECT_DATA=(SID=remote_SID)))' Now want to ...
-1
votes
1answer
357 views

Export only certain column on single table to csv format

I need to export certain column only of a database table to csv file. Here is the format of the source: ID | user_email | user_login | user_nickname | usergroup | address | user_registered | ...
1
vote
1answer
421 views

Oracle XMLAGG issue with combining cells that have comma separated values in cells

Have a situation where I'm trying to use xmlagg to get: | ID | name row1 | 1 | apple row2 | 1 | apple,pear,banana row3 | 1 | apple,banana row4 | 1 | pear,banana,orange row5 | 2 | orange ...
0
votes
2answers
4k views

how to import a huge csv file into Cassandra?

I am trying to import a csv file into Cassandra which is very long. These are food products: ingredients, nutrition, labels... It comes from Open Food Data. List information on food products: ...
1
vote
1answer
27 views

How to relate LatLong and State columns on PowerBI

I have two separate tables, one with latitude and longitude columns (for locations in the USA), and the other with the US state abbreviation (TX, AZ, CA, etc). Is there a way to count the number of ...
2
votes
1answer
126 views

PostgreSQL: simple equality query returning no results for indexed columns

I have a very large table (around 140M rows) with five columns: CREATE TABLE IF NOT EXISTS citations ( citing_id text, citing_issn text, cited_id text, cited_issn text, year int ); ...
3
votes
1answer
588 views

T-SQL: CSV->table pipeline with custom parsed numeric data, lookup values

Problem Wish to insert thousands of records into a table [Child] from a CSV file (and do this from tens of files into the same table). However, I want to A. substitute a lookup value into the table (...
3
votes
1answer
197 views

Dynamic paths for postgres file_fdw (csv)

I've got a postgres database which relies on the use of foreign tables to support the loading of large data sets based on user-provided (system sanitized) tables. I'd use COPY, but the tables loaded ...
6
votes
2answers
1k views

Very large SQL Server 2016 result sets (over 75 GB) to a CSV file?

What is the best way to get very large SQL Server 2016 result sets (over 75 GB) to a CSV file? The engineers need this output to look for correlations. The bcp route for a 73.5 GB file filled up ...
2
votes
1answer
10k views

Import Data from 48 GB csv File to SQL Server

I am importing huge data file of size around 48 gb using SQL Server default Import Tool. It keeps on executing fine for app. 13000000 Row insertions but after it the Task Fails with following error. ...
0
votes
1answer
348 views

select distinct on csv data

A table has CSV data and I want to do a SELECT DISTINCT ID on that table, how should I proceed? +-----------+ | id | +-----------+ | 111,1487 | +-----------+ | 462 | +-----------+ | ...
1
vote
1answer
101 views

Why does my database structure and SELECT operations generate NULLs?

I'm not too experienced with database problems, so please excuse the wall of text, I believe the context is important to understand the problem and goal. I receive a CSV file from another system ...