FAQ Database Discussion Community


for x in List - csv read / write

python,csv,export-to-csv
i'm struggling a bit here. I have the following code (with the help of some other great python experts here): skip = [11, 15, 30, 31, 32, 34, 41, 45, 55, 58, 59, 62, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80]...

PowerShell DataSet — array trimming and export to CSV

powershell,dataset,export-to-csv
I'm having some problem extracting values from this function: function Get-DatabaseData { [CmdletBinding()] param ( [string]$connectionString, [string]$query, [switch]$isSQLServer ) if ($isSQLServer) { Write-Verbose 'in SQL Server mode' $connection = New-Object -TypeName System.Data.SqlClient.SqlConnection } else { Write-Verbose 'in OleDB mode' $connection = New-Object -TypeName System.Data.OleDb.OleDbConnection } $connection.ConnectionString = $connectionString $command =...

CSV formatting - strip qualifier from specific fields

csv,export-to-csv
I am sorry if this question as been asked before, but I couldn't find anything similar. I am receiving CSV output that uses " as a text qualifier around every field. I am looking for an elegant solution to reformat these so that only specific (alphanumeric fields) have these qualifiers....

data exchange format ocaml to python numpy or pandas

python,numpy,ocaml,export-to-csv,hdf5
I'm generating time series data in ocaml which are basically long lists of floats, from a few kB to hundreds of MB. I would like to read, analyze and plot them using the python numpy and pandas libraries. Right now, i'm thinking of writing them to csv files. A binary...

Export dynamic fields from Access to csv (schema.ini?)

vba,ms-access-2010,export-to-csv
I'm trying to export a crosstab query from Access 2010 to a csv without a text qualifier. I'm able to use the Transfer Text method with my other exports; the trick with this one is that the number of fields (and their names) change depending on what the user selects...

Avoid double quote confusion when generating CSV files?

ruby,csv,formatting,string-formatting,export-to-csv
I am pushing some strings to a CSV file: csv_string = CSV.generate({col_sep: ";", row_sep: "\n"}) do |csv| csv << ["101-41", "Sparri, \"Violet\" (rod) (1 bunt á 10 stk.)"] end When the CSV file is finally generated a regular Excel installation will display the content apparently corrent, but a closer look...

Powershell script for Excel error code

excel,powershell,csv,export-to-csv,powershell-v4.0
I'm trying to convert an Excel .xls file that has several worksheets into a .csv with Powershell 4.0. I know the SaveAs in the for each loop isn't phrased right, and that the error is pointing to line 17 and character 9, I just don't know how to fix it...

how to write CSV FILE after modification in specific numeric column values using java

java,csv,filestream,export-to-csv,opencsv
i have a dataset csv file having around 46000 instance and 17 attributes.. then i extract on of the column values and modify its value by incremented by 1 now i want csv file with modified values.how can i get.... import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; import java.util.logging.Level; import java.util.logging.Logger;...

Bash Script to generate csv file from text

bash,shell,sh,export-to-csv
I have a text file with records: Data1 Data2 ... Data50 I have to create a .csv file from the above text file in the following format: Type | Count | Name Def | u1 | Data1 Def | u2 | Data2 .... | ..... | .... Def | u50...

Excel table using Powershell

excel,powershell,table,export-to-csv
I have an excel file with 2 tables on the first sheet. Can I pull excel tables using powershell. Currently using powershell v3 with excel 2007. I'm aiming to convert those table to csv file separately for other purpose. *Edited for clarification The table should be reference by tables name...

Can I direct mysql to include the column header as the first line of a CSV export without using other scripting languages?

mysql,export-to-csv
I'm migrating content out of an old proprietary database in a new more structured solution. The new solution asks for CSV files. For approval process -- to be checked by a human eye balls -- I need to have column names as the first line in this CSV file. select...

Export to Excel from stored procedure - SQL blocked

sql,sql-server,sql-server-2012,export-to-excel,export-to-csv
I have a stored procedure that I'm trying to export to excel. insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=c:\sales.xls;;HDR=YES', 'SELECT * FROM [Sheet1$]') exec des_z_test '19FDA2C7-E494-E411-80D2-0050568C3F74', 'E1AB4FD4-4C3B-E411-80D2-0050568C3F74' However, I'm getting this error. The stored procedure runs fine on it's own. I suspect the issue is from the insert statement Msg 15281, Level...

RDF file to excel-readable format

rdf,export-to-csv
I downloaded an rdf file of the format .ttl - I am new to RDF and I am trying to see if I can get the data in a simple txt/csv format of some sort. Does anyone know how to do this?

Writing Data Into CSV Format File

python,mongodb,csv,pymongo,export-to-csv
I'm trying to write some data into CSV format using fetched data from MongoDB, with Mongopy. Currently, the headers are currently set, and the problem is that the actual data is not being inserted into the CSV file. here is the code snippet : from pymongo import MongoClient import csv...

Powershell foreach loop export to new column in csv

powershell,csv,export-to-csv
I am currently working with a CSV file that has a manager's employee number but not their SAMAccountName. What I want to do is utilize Get-ADUser to grab the manager's SAMAccountName from their EmployeeNumber attribute and place that inside a new column in the same CSV file. CSV Sample: "Full...

How do you check the class of a Python csv.writer instance?

python,csv,export-to-csv
I have a function that will write a python list to various formats. csv is one of the formats I would like to write out to. I know i use the built-in csv Python module, but my function is currently written in the following manner: def foo(self, save_to=None): if save_to...

Exporting CSV with UTF8 to Excel using PHP

php,csv,character-encoding,export-to-csv
my client asked me to build an export system that export the whole SQL database into csv file that works on excel. I found PHPexcel and it's great, but I thought I can do stuff way more easier and faster using my own functions. After struggling with Excel encoding, I...

How To Export Data to CSV: Dynamic SQL Query and Dynamic Column Names and data on JTable (Java/Netbeans)

java,excel,export,export-to-csv
I am trying to find out the easiest manner to export data from a JTable into an excel format like CSV or XLSX etc. The problem is the data is dynamic, so basically the user can run a dynamic query and he/she would require to export that data.

My python script when executed prints values to a single column of the excel document in which it is opened

python,csv,export-to-csv
I've been attempting to copy over lines from a csv(comma delimited) to another csv file after performing a simple check. But, the newly created output happens to be in a single column. How can I fix this? I've already attempted to migrate over values using the text solution in excel...

Exporting Beautiful Soup table scrape results to CSV

python,csv,web-scraping,beautifulsoup,export-to-csv
Python beginner here, first attempt at using the CSV module to export scrape results. The script in question returns several table elements, only interested in the "price" and "mfr-no" for each of the returned products. Basically just want 2 columns for each of these respective elements. I'm sure I'm doing...

Append Quotes for all VARCHAR Columns when exporting to csv file

sql,sql-server,csv,export-to-csv,autosys
I have a stored procedure which when run gives a table output. I want to export this procedure to a csv file but want to append double/single quotes for all the columns with a datatype CHAR/VARCHAR. For Example: Stored Proc O/P: ID Name Address SSN 1 abd 9301,LeeHwy, 22031 64279100...

how to parse multiple rows from a csv file using php

php,parsing,csv,export-to-csv
i have 2 .csv files which have first column having similar values, the code which is included does the job only for one row, it does only one iteration, kindly help me modify the code... hostrefined.csv contents... name1,23423,detail1 name2,12312,detail2 name3,21312,detail3 hbarefined.csv contents... name1,det1,det2,2323 name1,det3,det4,23434 name1,det5,det6,34343 name2,det9,det7,232322 name3,det10,det28,232 the output file...

Exporting Data from Cassandra to CSV file

apache,csv,cassandra,export,export-to-csv
Table Name : Product uid | productcount | term | timestamp 304ad5ac-4b6d-4025-b4ea-8b7991a3fe72 | 26 | dress | 1433110980000 6097e226-35b5-4f71-b158-a1fe39a430c1 | 0 | #751104 | 1433861040000 Command : COPY product (uid, productcount, term, timestamp) TO 'temp.csv'; Error: Improper COPY command. Am I missing something? ...

CSV data export with headers using PHP SQL server

php,csv,sql-server-2012,export-to-csv
I am trying to export the data from table on SQL server database to the CSV file. Data is formatted correctly and placed in each separate cells on the file. But the header is not formatted properly and is printed all on to one cell as a continuous stream. Say...

Data from SQL to be exported into CSV (New line issue), I use C# coding on export [duplicate]

c#,sql,sql-server,lambda,export-to-csv
This question is an exact duplicate of: SQL Query to Lambda C# 2 answers I have data that contains Char(13) and Char(10) on my database, upon exporting the data onto csv, some data on the last fields create a new line in which it wrecks the other rows. for...

Exporting treetable to Excel/CSV

java,export-to-excel,oracle-adf,export-to-csv
I'm trying to export a treetable to excel/CSV using this tutorial However, I can't import some stuff like: WritableSheet, WritableFont, WorkbookSettings, etc... What do I need?...

Access python for loop values

python,csv,web-scraping,beautifulsoup,export-to-csv
I'm experimenting a bit with Python and am trying to build a scraper. Code I already have is printed below. import requests from bs4 import BeautifulSoup import csv url = "http://www.grammy.com/nominees/search" r = requests.get(url) soup = BeautifulSoup(r.content) g_data = soup.find_all("div", {"class": "view-content"}) f = csv.writer(open("file.csv", "w")) f.writerow(["Year", "Category", "Title", "Winner"])...

DevExpress ExportToText / ExportToCSV fail to produce stream

vb.net,devexpress,export-to-csv,xtragrid
I am trying to basically export a Grid contents to a CSV file. The datasource checks out fine as I pass the exact same SQL to a physical grid and its fine. But when I try to create the Grid and View dynamically - and Export the contents - the...

Export USP Results To CSV

sql-server-2000,export-to-csv
I have a stored procedure which basically runs a insert into statement for about 5 tables and places all the data into 1 table (easier to work with this way). I was wanting to instead of inserting into the table, just exporting each result-set into a different csv file (taking...

stored procedure to export to CSV with BCP

sql-server,stored-procedures,asp-classic,export-to-csv,bcp
I need to create an on-demand export of user data on our website. The user clicks an export button, classic ASP code executes a stored procedure that generates a file via BCP, and the user is prompted to download it. I've created the sproc, and its working flawlessly when executed...

Unable to write on the first line of csv using php

php,csv,utf-8,export-to-csv,byte-order-mark
Background I am using php to write a csv file contain Chinese character. However,they cannot display well. I found the problem is excel does not read utf8 without BOM. And I need to add the BOM on the first line and it works if I put \xEF\xBB\xBF on the first...

Passing properties to a function pipeline output error

function,powershell,csv,export-to-csv,pipeline
I'm getting this error when I add to the return the -prefix "File_Name" to the end of Return $Results | Out-Excel -Prefix "File_Name" if I leave -prefix "File_Name" off of the script it works. What am I missing? Out-Excel : The input object cannot be bound to any parameters for...

ui-grid using external Pagination and exporting data

angularjs,pagination,export-to-csv,angular-ui-grid
I am currently using ui-grid implemented with external pagination to display my data. I've run into as issue where I can only export the currently viewed data, however I need to be able to export ALL data as well. Anyone know a work around to export all data using external...

R write dataframe column to csv having leading zeroes

r,csv,export-to-csv
I have a table that stores prefixes of different lengths.. snippet of table(ClusterTable) ClusterTable[ClusterTable$FeatureIndex == "Prefix2",'FeatureIndex', 'FeatureValue')] FeatureIndex FeatureValue 80 Prefix2 80 81 Prefix2 81 30 Prefix2 30 70 Prefix2 70 51 Prefix2 51 84 Prefix2 84 01 Prefix2 01 63 Prefix2 63 28 Prefix2 28 26 Prefix2 26 65...

Save query results to .csv with PHP

php,codeigniter,export-to-csv
I have the following query running and I am looking at the best way to export the data to a .csv or .xls file. <?php $channels = ee()->db->select('channel_titles.entry_id, channel_titles.title, channel_data.field_id_164') ->from('channel_titles') ->join('channel_data', 'channel_titles.entry_id = channel_data.entry_id') ->where(array( 'channel_titles.channel_id' => '12', )) ->or_where(array( 'channel_titles.channel_id' => '31', )) ->get(); if ($channels->num_rows() > 0)...

Highcharts Export to CSV No Data Grouping

highcharts,export-to-csv
https://github.com/highslide-software/export-csv Using this plugin, is there any way to export the data from highcharts prior to it data grouping my data? Data grouping or Data Approximation. If I bring a lot of data back from the database, it is data grouping my dates so that there is a datapoint every...

Magento include products sku in orders CSV

magento,export-to-csv,orders
The default orders export CSV file does not contain sku of the products. Is there any way i can include sku of the products in an order. Any help will be highly appropriated. Thanks...

Exporting tables to csv- separating tables in a list- shiny

r,csv,shiny,export-to-csv
I have a list of tables (df_list). I want to export them to csv in shiny. When exporting the list of tables to csv I open them in excel. In excel the list of tables are put into columns and the columns referred to by tablename.colname. I would like to...

Export an array in .csv using

php,csv,php-5.3,export-to-csv,php-5.4
I have a problem with my .csv. So I tried to generate a .csv from an array using php. In the view I have : <form id="form_logistique" action="myroute" method="post"> <div class="form-group " style="float: left;"> <label class="control-label" for="" style="display: inline-block; padding-right: 20px;">Date min</label> <input type="text" id="date_min" name="date_min.name" value="date_min" placeholder="Date min" class="form-control...

Error on Dynamic csv file export using plpgsql copy to csv in a function

postgresql,plpgsql,export-to-csv,postgresql-copy
I am trying to filter a postgresql table for rows that have a product id as a foreign key. For each product id, I need to export 1 csv each to a folder eg , prod1.csv, prod2.csv etc. I have tried to create the function below to automate this but...

writing plotOverline csv data from paraview for all time steps with python script

python,csv,scripting,export-to-csv,paraview
I am trying to extract the data (as csv) from a line for all the time steps with the PlotOverLine filter in Paraview. In the GUI, I load the foam file, use the PlotOverLine filter and save the spread sheet view as csv file and click the next button in...

Merge two CSV files with no headers in Powershell

powershell,export-to-csv
I have two CSV files and neither have headers. Both CSV files have the same amount of lines in them. Here's an example: csv1.csv: 1,2 3,4 5,6 csv2.csv: a,b c,d e,f I would like the output to look like this: 1,2,a,b 3,4,c,d 5,6,e,f I don't want to add headers or...

How to export the resulting data in PostgreSQL to .CSV?

postgresql,export-to-csv
I use PostgreSQL 9.4.1 My query: copy(select * from city) to 'C:\\temp\\city.csv' copy(select * from city) to E'C:\\temp\\city.csv' ERROR: relative path not allowed for COPY to file ********** Error ********** ERROR: relative path not allowed for COPY to file SQL state: 42602 ...

How to export data from a PivotTable to .csv in a specific format?

excel,excel-formula,pivot-table,export-to-csv,worksheet-function
I have a worksheet with 65000 rows. The first cell in each row is from a list of 1,500 values. For example: PartNumber1|Application1 PartNumber1|Application2 PartNumber1|Application3 PartNumber2|application1 Partnumber2|Application2 PartNumber3|Application1 PartNumber3|Application2 PartNumber3|Application3 Etc... I need to get an output like the following PartNumber1,Application1,application2,application3 PartNumber2,Application1,Application2 PartNumber3,Application1,Application2,Application3 ....etc Now, in Excel, I can create...

New to PowerShell

powershell,export-to-csv,get-eventlog
I am extremely new to PowerShell I am trying to create a script that will look thought the system event log and pull out the items that match Error, Verbose , and Warnings; Then I want to export them to a CSV file. I was able to get each of...

characters converted to dates when using write.csv

r,export-to-csv
my data frame has a column A with strings in character form > df$A [1] "2-60", "2-61", "2-62", "2-63" etc I saved the table using write.csv, but when I open it with Excel column A appears formatted as date: Feb-60 Feb-61 Feb-62 Feb-63 etc Anyone knows what can I do...

How can I export my quiz results to a csv file using python 3? [duplicate]

python,csv,python-3.x,export-to-csv
This question already has an answer here: TypeError: Can't convert 'int' object to str implicitly 1 answer I want the results to be in the format Date, Question, Name and Score file = open("results.csv", "a") file.write('Date, Question, Name, Score\n' + date + ',' question + ',' + name +...

php excel reader - ignore cells with special symbols

php,excel,csv,xls,export-to-csv
I use the parser for converting xls to csv http://code.google.com/p/php-excel-reader/ <?php set_time_limit(300); require_once 'excel_reader2.php'; $data = new Spreadsheet_Excel_Reader("file.xls", false, 'UTF-8'); $f = fopen('file.csv', 'w'); for($row = 1; $row <= $data->rowcount(); $row++) { $out = ''; for($col = 1; $col <= $data->colcount(); $col++) { $val = $data->val($row,$col); // escape " and...

Wordpress Export Custom Table to CSV

wordpress,export-to-csv
I've got a custom database table that I'm storing information to and I need to export selected rows(id's) to a csv file. Currently I have added a an option for "Export" to my bulk actions and it will export the entire table to a CSV file, but I need to...

TYPO3 Flow: Convert object to array for CSV export

php,doctrine2,export-to-csv,typo3-flow
I want to export my object "mitglied" to a .csv-file. My controller looks like that: public function exportAction() { // find all mitglieds $records = $this->mitgliedRepository->findTennis(); // Set path for export-file $csvPath = '/var/www/apps/flow/Packages/Application/ITOOP.Atc/Resources/Private/Export/test.csv'; $fp = fopen($csvPath, 'w'); foreach ($records as $lines) { fputcsv($fp, $lines); } fclose($fp); } When I...

iPython: Unable to export data to CSV

ipython-notebook,export-to-csv
I have searched a multiple articles, but unable to get iPython (Python 2.7) to export data to a CSV, and I do not receive an error message to troubleshoot the specific problem, and when I include "print(new_links)" I obtain the desired output; thus, this issue is printing to the csv....

Console table output -> csv file - Export-csv

powershell,export-to-csv,user-profile
I'm listing all "User Profile Properties" in the console by "Displayname, name and Type" Is there a easy way to export the table output in console to a csv file? This is probably a question that has been asked many times before but I can't manage to find a good...

Xml file to CSV output

xml,bash,csv,export-to-csv
I have xml file, which is in format as below, and I want to transform it in csv otput as shown below. Unfortunatly I'm not allowed to install xmlstarlet or some other xml parser (I have only xmllint). How can I do this, for example with, awk, sed.... <xn:VsDataContainer id="site00881">...