export-to-csv

Mongoexport to multiple csv files

佐手、 提交于 2020-06-12 09:12:00
问题 I have a large mongoDB collection. I want to export this collection to CSV so I can then import it in a statistics package to do data analysis. The collection has about 15 GB of documents in it. I would like to split the collection into ~100 equally sized CSV files. Is there any way to achieve this using mongoexport? I could also query the whole collection in pymongo, split it and write to csv files manually, but I guess this would be slower and would require more coding. Thank you for input.

How to populate data on UI after reading from CSV file in Angular?

大憨熊 提交于 2020-06-01 04:46:27
问题 I am implementing angular template and I am reading CSV file data to show it in an organized table. I am not strong at core scripting part based on retrieved csv data. I am sharing my code: export class AppComponent implements OnInit{ title = 'temp-app'; public headers = []; public data = {}; public strData = '' public selectedHeader = null; constructor(private fileSvc: FileService) { } ngOnInit(): void { this.fileSvc.getHeaders().subscribe( data => { if (data != null && data.length > 0) {

How can an associative multidimensional (multiple dimensions) PHP array get converted to downloadable CSV?

我的梦境 提交于 2020-04-30 06:24:50
问题 I have an associative multidimensional (dynamic length of dimensions) array. It originally comes from JSON data, but I understand that just makes things harder so I convert it using json_decode($original_data, true) . I'm interested to convert it to a clickable CSV file like echo '<a href="data:application/csv, ' . $data . '">Click to download</a>' . I've tried many code variations, one of which I found online in https://coderwall.com/p/zvzwwa/array-to-comma-separated-string-in-php because

Convert excel file (xls or xlsx) to csv file

别说谁变了你拦得住时间么 提交于 2020-04-16 06:00:26
问题 I need this code C# working for files excel 2003 and 2007 version. I can't get this C# code working to convert excel file (xls) on csv file. If try with excel file extension xlsx it's all ok but if try with extension xls I have error in this line: result.Tables[0].TableName.ToString(); My code below, what's wrong? code-behind FileUploadControl.SaveAs(Server.MapPath("/public/") + filename); System.IO.FileStream stream = File.Open(filePath, FileMode.Open, FileAccess.Read); Excel

Combining multiple csv files into one csv file

拜拜、爱过 提交于 2020-04-11 17:13:06
问题 I am trying to combine multiple csv files into one, and have tried a number of methods but I am struggling. I import the data from multiple csv files, and when I compile them together into one csv file, it seems that the first few rows get filled out nicely, but then it starts randomly inputting spaces of variable number in between the rows, and it never finishes filling out the combined csv file, it just seems to continuously get information added to it, which does not make sense to me

How to split one csv into multiple files in python

╄→尐↘猪︶ㄣ 提交于 2020-03-25 17:50:31
问题 I have a csv file (world.csv) looks like this : "city","city_alt","lat","lng","country" "Mjekić","42.6781","20.9728","Kosovo" "Mjekiff","42.6781","20.9728","Kosovo" "paris","42.6781","10.9728","France" "Bordeau","16.6781","52.9728","France" "Menes","02.6781","50.9728","Morocco" "Fess","6.6781","3.9728","Morocco" "Tanger","8.6781","5.9728","Morocco" And i want to split it to multiple file by country like this: Kosovo.csv : "city","city_alt","lat","lng","country" "Mjekić","42.6781","20.9728",

Scrape Highcharts data to CSV file

删除回忆录丶 提交于 2020-02-29 07:51:43
问题 I want to scrape historical data of specific coins from the CoinMarketCap website using Python. I want as granular data as possible. I think the data comes from the following string : I want to use BeautifulSoup to get this data and save it to a CSV file, but I have no clue how. 回答1: It seems it uses JavaScript which use url https://graphs.coinmarketcap.com/currencies/verge/1513624444000/1514229244000/ to get data as JOSN so you can easily get it as python dictionary EDIT: it uses timestamp

Scrape Highcharts data to CSV file

北城余情 提交于 2020-02-29 07:50:38
问题 I want to scrape historical data of specific coins from the CoinMarketCap website using Python. I want as granular data as possible. I think the data comes from the following string : I want to use BeautifulSoup to get this data and save it to a CSV file, but I have no clue how. 回答1: It seems it uses JavaScript which use url https://graphs.coinmarketcap.com/currencies/verge/1513624444000/1514229244000/ to get data as JOSN so you can easily get it as python dictionary EDIT: it uses timestamp

Scrape Highcharts data to CSV file

♀尐吖头ヾ 提交于 2020-02-29 07:50:27
问题 I want to scrape historical data of specific coins from the CoinMarketCap website using Python. I want as granular data as possible. I think the data comes from the following string : I want to use BeautifulSoup to get this data and save it to a CSV file, but I have no clue how. 回答1: It seems it uses JavaScript which use url https://graphs.coinmarketcap.com/currencies/verge/1513624444000/1514229244000/ to get data as JOSN so you can easily get it as python dictionary EDIT: it uses timestamp

convert a fixed width file from text to csv

南笙酒味 提交于 2020-02-17 05:44:28
问题 I have a large data file in text format and I want to convert it to csv by specifying each column length. number of columns = 5 column length [4 2 5 1 1] sample observations: aasdfh9013512 ajshdj 2445df Expected Output aasd,fh,90135,1,2 ajsh,dj, 2445,d,f 回答1: GNU awk (gawk) supports this directly with FIELDWIDTHS , e.g.: gawk '$1=$1' FIELDWIDTHS='4 2 5 1 1' OFS=, infile Output: aasd,fh,90135,1,2 ajsh,dj, 2445,d,f 回答2: I would use sed and catch the groups with the given length: $ sed -r 's/^(.