export-to-csv

Prompt a csv file to download as pop up using node.js and node-csv-parser (node module)

有些话、适合烂在心里 提交于 2019-11-29 21:56:42
Recently I have started working with node.js. While going through a requirement in one of my projects I am facing an issue where I should be able to write some data to a csv file dynamically and let it prompt as a popup to download for user (with save and cancel options - as we normally see). After googling for some time I decided to use csv npm module https://github.com/wdavidw/node-csv-parser . I am able to write data into a file and save it using this module. I want to prompt a popup for saving this file with/without saving the file. my code looks something like this: // Sample Data var

characters converted to dates when using write.csv

左心房为你撑大大i 提交于 2019-11-29 21:02:56
问题 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 to avoid this? I tweaked the arguments of write.csv but nothing worked, and I can't seem to find an example in Stack Overflow that helps solve this problem. 回答1: Another solution - a bit tedious, Use Import Text File in Excel,

Most efficient way of exporting large (3.9 mill obs) data.frames to text file? [duplicate]

。_饼干妹妹 提交于 2019-11-29 20:38:16
This question already has an answer here: Speeding up the performance of write.table 6 answers I have a fairly large dataframe in R that I would like to export to SPSS. This file has caused me hours of headaches trying to import it to R in the first place, however I got successful using read.fwf() using the options comment.char="%" (a character not appearing in the file) and fill= TRUE (it was a fixed-width ASCII file with some rows lacking all variables, causing error messages). Anyway, my data frame currently consists of 3,9 mill observations and 48 variables (all character). I can write it

CsvHelper ConvertUsing not changing output

落爺英雄遲暮 提交于 2019-11-29 18:17:23
问题 I'm trying to use the ConvertUsing method of the CsvHelper library (v 2.4.0). I've read the documentation about ConvertUsing but can't get it to work. I'm using a simple class: public class Test { public long Id { get; set; } public string Title { get; set; } } With this ClassMap : public class TestClassMap : CsvClassMap<Test> { public override void CreateMap() { Map(m => m.Id).Name("id").ConvertUsing(row => 11111); Map(m => m.Title).Name("title").ConvertUsing(row => row.GetField("title") + "

Can I use \\copy command into a function of postgresql?

我怕爱的太早我们不能终老 提交于 2019-11-29 17:23:58
I am trying to create this statement into a function: \copy aux("nombre") TO '/home/david/lugares.csv' delimiters ';'; So I do the next: CREATE OR REPLACE FUNCTION crearcsv() RETURNS void AS $BODY$ DECLARE STATEMENT TEXT; BEGIN RAISE NOTICE 'CREAR CSV'; STATEMENT:= '\copy aux ("nombre") TO ''/home/david/lugares.csv'' delimiters '';'';'; RAISE NOTICE '%',STATEMENT; EXECUTE STATEMENT; END;$BODY$ LANGUAGE plpgsql VOLATILE COST 100; But I get the next when I call to the function: NOTICE: \copy aux ("nombre") TO '/home/david/lugares.csv' delimiters ';'; ERROR: syntax error at or near "\" LINE 1:

Convert XSLX to CSV using VBA [duplicate]

为君一笑 提交于 2019-11-29 17:19:52
This question already has an answer here: Export sheet as UTF-8 CSV file (using Excel-VBA) 3 answers First of all, I'm quite amateur on VBA that why i need your help! I use the code below to convert .xlsx to .csv but somehow the character is not good to see.English is ok but Vietnamese character is not easy to see. For example, copy this text" Bạn đánh giá về nhà hàng của chúng tôi hôm nay như thế nào?" to xlsx file and use code below to convert to csv. Then the character is shown like this "Ba?n ?a?nh gia? vê? nha? ha?ng cu?a chu?ng to?i ho?m nay nhu? thê? na?o?" Anyone can help

Save output from sql function to csv file (COPY) with dynamic filename

℡╲_俬逩灬. 提交于 2019-11-29 17:19:07
I am running Postgres 9.3 on MacOSX. I am trying to add a COPY statement inside a function for an automatized save-to-file process. I am new to any kind of sql coding, so this is what I have so far; CREATE FUNCTION retrieve_info(input_method TEXT, input_species TEXT) RETURNS SETOF retrieve_info_tbl AS $$ SELECT tblA.id, tblA.method, tblA.species, tblA.location FROM tblA WHERE method=input_method AND species=input_species GROUP BY id, method, species ORDER BY location COPY (SELECT * FROM retrieve_info_tbl) TO 'myfilepath/filename.csv' WITH CSV; $$ LANGUAGE 'sql'; What the function does and

Export Pandas data frame with text column containg utf-8 text and URLs to Excel

我的未来我决定 提交于 2019-11-29 15:12:55
My Pandas data frame consists of Tweets and meta data of each tweet (300.000 rows). Some of my colleagues need to work with this data in Excel which is why I need to export it. I wanted to use either .to_csv or .to_excel which are both provided by Pandas but I can't get it to work properly. When I use .to_csv my problem is that it keeps failing in the text part of the data frame. I've played around with different separators but the file is never 100% aligned. The text column seems to contain tabs, pipe characters etc. which confuses Excel. df.to_csv('test.csv', sep='\t', encoding='utf-8') When

Powershell - Export-CSV and Append

爷,独闯天下 提交于 2019-11-29 13:51:07
I have a script such as the following: $in_file = "C:\Data\Need-Info.csv" $out_file = "C:\Data\Need-Info_Updated.csv" $list = Import-Csv $in_file ForEach ( $user in $list ) { $zID = $user.zID ForEach-Object { Get-QADUser -Service 'domain.local' -SearchRoot 'OU=Users,DC=domain,DC=local' -SizeLimit 75000 -LdapFilter "(&(objectCategory=person)(objectClass=user)(PersonzID=$zID))" | Select-Object DisplayName,samAccountName,@{Name="zID";expression={$zID}} | Export-Csv $out_file -NoTypeInformation -Force } } However, I am not able to get it to output all of the results to the $out_file since it does

Force SSRS 2008 to use SSRS 2005 CSV rendering

半世苍凉 提交于 2019-11-29 11:40:38
We are upgrading our report server from SSRS 2005 to SSRS 2008 R2. I have an issue with CSV export rendering for SSRS 2008 where the SUM of columns are appearing on the right side of the detail values in 2008 instead of the left side like in 2005 as shown in the below blocks. 117 and 131 are the sums of Column2 and Column3 respectively. SSRS 2005 CSV Output Column2_1,Column3_1,Column2,Column3 117,131,1,2 117,131,1,2 117,131,60,23 117,131,30,15 117,131,25,89 SSRS 2008 CSV Output Column2,Column3,Column2_1,Column3_1 1,2,117,131 1,2,117,131 60,23,117,131 30,15,117,131 25,89,117,131 I understand