export-to-csv

Exporting spark dataframe to .csv with header and specific filename

寵の児 提交于 2019-12-08 19:35:47
问题 I am trying to export data from a spark dataframe to .csv file: df.coalesce(1)\ .write\ .format("com.databricks.spark.csv")\ .option("header", "true")\ .save(output_path) It is creating a file name "part-r-00001-512872f2-9b51-46c5-b0ee-31d626063571.csv" I want the filename to be "part-r-00000.csv" or "part-00000.csv" As the file is being created on AWS S3, I am limited in how I can use os.system commands. How can I set the file name while keeping the header in the file? Thanks! 回答1: Well,

Excel exporting hundreds of empty columns on CSV export

做~自己de王妃 提交于 2019-12-08 19:29:01
问题 Before I begin, I'm using Excel for Mac 2011. I'm having a problem with a particular Excel spreadsheet. When I export any of the active worksheets to CSV (windows CSV format), it exports ~200 blank columns along with the 7 or 8 populated columns. I've had a similar issue in the past, and found a site that said the way to fix it was to find all blank characters, and replace them with a space. This worked in the past, and any blank columns were not export anymore. This doesn't seem to be the

JSoup extract table as CSV from finance website

£可爱£侵袭症+ 提交于 2019-12-08 17:48:25
My problem is the following: I want to extract a table from an html file downloaded from a website using JSoup and return it as csv-file. (The data is historic stock prices). Here is the website: http://www.finanzen.ch/kurse/historisch/Actelion/VIRTX/12.6.2013_17.9.2013 It is in German, so I hope this is no problem. I want to extract the table with all the numbers. I have got the following code so far: Document doc = Jsoup.connect("http://www.finanzen.ch/kurse/historisch/Actelion/VIRTX/12.6.2013_17.9.2013").get(); for (Element table : doc.select("table.Historische Kurse Actelion Ltd.*")) { for

Inserting multiline text in a csv field

倾然丶 夕夏残阳落幕 提交于 2019-12-08 15:04:43
问题 I want to insert a multiline text data in a CSV field. Ex: var data = "\nanything\nin\nthis\nfield"; var fields = "\"Datafield1\",\"Datafield2:"+data+"\"\n"; When I save fields into a csv file and open it using MS Excel, I get to see only the first column. But when I open the file using a text editor I see: "Datafield1","Datafield2: anything in this field" I don't know whether I am going against CSV standards. Even if I am going against Please help me with a workaround. Thanks... 回答1: By

How to export dictionary as CSV using Python?

こ雲淡風輕ζ 提交于 2019-12-08 14:12:10
问题 I am having problems exporting certain items in a dictionary to CSV. I can export 'name' but not 'images' (the image URL). This is an example of part of my dictionary: new = [{ "name" : "peter", "picture" : "https://img.evbuc.com/https%3A%2F%2Fcdn.evbuc.com%2Fimages%2F33500665%2F25911657759%2F1%2Foriginal.jpg?h=200&w=450&rect=0%2C581%2C6000%2C3000&s=bfaa2901b8c906a66c51563d15c6df12"}, {"name" : "jim" , "picture" : "https://img.evbuc.com/https%3A%2F%2Fcdn.evbuc.com%2Fimages%2F32935536

jQuery export to Excel, include html th rows

谁说胖子不能爱 提交于 2019-12-08 12:46:07
问题 I have the fiddle, modified from another forum that exports an html table to CSV with jQuery. This works perfectly however I cannot get it to include the table header rows. The fiddle is at: http://jsfiddle.net/KPEGU/480/ I have messed around with the below syntax without any luck: var $rows = $table.find('tr:has(td)'), is it something to do with: $cols = $row.find('td'); So I am looking for output to include headings, not just normal table rows. complete script is: $(document).ready(function

JSoup extract table as CSV from finance website

佐手、 提交于 2019-12-08 07:51:27
问题 My problem is the following: I want to extract a table from an html file downloaded from a website using JSoup and return it as csv-file. (The data is historic stock prices). Here is the website: http://www.finanzen.ch/kurse/historisch/Actelion/VIRTX/12.6.2013_17.9.2013 It is in German, so I hope this is no problem. I want to extract the table with all the numbers. I have got the following code so far: Document doc = Jsoup.connect("http://www.finanzen.ch/kurse/historisch/Actelion/VIRTX/12.6

SSIS: Script task to write recordset to file

不打扰是莪最后的温柔 提交于 2019-12-08 07:42:56
问题 I am using SQL Server Data Tools 2013 to create an SSIS package. This package has an Execute SQL Task with a Full Resultset option to push the query results into an SSIS Variable, of type Object. I'm using the following in a script task to take a recordset stored in an object variable and write it to a CSV: Public Sub Main() Dim fileName As String = Dts.Variables("vFileName").Value.ToString Dim destinationPath As String = Dts.Variables("vDestinationPath").Value.ToString Dim

Exporting data from database in php,and the file format for excel export should be as windows 97-2003 workbook

霸气de小男生 提交于 2019-12-08 04:43:02
问题 Below is my code to export data from mysql database. It works properly, but while exporting excel file, file saved as in tab delimeter format. I just need to save it in windows 97-2003 workbook. I keep changing on header's, but it doesn't work.. while open those file it popups some alert such as "the file you are trying to open,'filename.xls', is in different format than specified by the file extension.." I need to rid on it. Can any one give suggestion.. thanks in advance :) HTML coding:

How to inject $http service into the ng-grid csv export plugin

江枫思渺然 提交于 2019-12-08 03:52:47
问题 I am trying to tackle a TODO in the ng-grid csv export plugin: "add a config option for IE users which takes a URL. That URL should accept a POST request with a JSON encoded object in the payload and return a CSV. This is necessary because IE doesn't let you download from a data-uri link" However, because of my somewhat limited understanding of AngularJS, ng-grid and ng-grid plugins, I am struggling with how to access the $http service (which I need to use to post the data) from within the