csv

How to read values from a comma separated file?

依然范特西╮ 提交于 2021-02-07 09:11:23
问题 I want to read words in a text file of a line separated by commas in c sharp. For example, I want to read this line: 9/10/2011 10:05,995.4,998.8,995.4,997.5,118000 and get the values: 9/10/2011 10:05 , 995.4 , 998.8 , 995.4 , 997.5 and 118000 . Next, I also need to change the format of the date to MMddYYYY , and of the time to HHmmss (e.g. 100500 ). I am using this code for reading is there anything wrong private void button1_Click(object sender, EventArgs e) { StreamReader reader1 = File

How to read values from a comma separated file?

主宰稳场 提交于 2021-02-07 09:11:16
问题 I want to read words in a text file of a line separated by commas in c sharp. For example, I want to read this line: 9/10/2011 10:05,995.4,998.8,995.4,997.5,118000 and get the values: 9/10/2011 10:05 , 995.4 , 998.8 , 995.4 , 997.5 and 118000 . Next, I also need to change the format of the date to MMddYYYY , and of the time to HHmmss (e.g. 100500 ). I am using this code for reading is there anything wrong private void button1_Click(object sender, EventArgs e) { StreamReader reader1 = File

Converting xls to semicolon delimited csv with soffice commandline

半城伤御伤魂 提交于 2021-02-07 08:39:47
问题 I'm trying to convert xls files in a directory to csv format using soffice. soffice --headless --convert-to csv * It is giving comma separated version(obviously). Now I want to get semi-colon delimited csv. I thought of replacing commas with semi-colons using vim command. :%s/,/;/g But it's not correct, as it replaces commas which are kept intentionally in original content. It has to delimit while converting from xls to csv. How to get semi-colon delimited csv with soffice command line? 回答1:

Converting xls to semicolon delimited csv with soffice commandline

和自甴很熟 提交于 2021-02-07 08:39:06
问题 I'm trying to convert xls files in a directory to csv format using soffice. soffice --headless --convert-to csv * It is giving comma separated version(obviously). Now I want to get semi-colon delimited csv. I thought of replacing commas with semi-colons using vim command. :%s/,/;/g But it's not correct, as it replaces commas which are kept intentionally in original content. It has to delimit while converting from xls to csv. How to get semi-colon delimited csv with soffice command line? 回答1:

Converting xml to csv from XQuery in BaseX

不想你离开。 提交于 2021-02-07 08:38:53
问题 The reason for which I'm writing is because I have a database of approx 1k of xmls in BaseX. I already cleaned it and got the info I wanted. Nevertheless, I want to be able to export that data in the CSV format. When I tried with the code given in the BaseX documentation it gave me this: Desc,Cantidad,Valor,Fecha,Lugar,UUID ,,,,, ,,,,, And it should show the data between the commas. What I am asking is how should I modify my code in order for the data to appear. My code is the following:

Converting xml to csv from XQuery in BaseX

非 Y 不嫁゛ 提交于 2021-02-07 08:37:41
问题 The reason for which I'm writing is because I have a database of approx 1k of xmls in BaseX. I already cleaned it and got the info I wanted. Nevertheless, I want to be able to export that data in the CSV format. When I tried with the code given in the BaseX documentation it gave me this: Desc,Cantidad,Valor,Fecha,Lugar,UUID ,,,,, ,,,,, And it should show the data between the commas. What I am asking is how should I modify my code in order for the data to appear. My code is the following:

Perform Download via download button in Python

无人久伴 提交于 2021-02-07 08:32:32
问题 I am somehow new in the region of getting data from a website. I have, e.g. a website http://www.ariva.de/adidas-aktie/historische_kurse and there is a donwload button hidden as shown in the picture below in red: The main question is how can I download that in python? I tried some stuff found on the web (e.g. like beautiful soup, scraperwiki etc.) but somehow failed. The data download link is structured as the following: > Kurse als CSV-Datei </h3> <div class="clearfloat"></div> </div> >

Writing out results from python to csv file [UnicodeEncodeError: 'charmap' codec can't encode character

六眼飞鱼酱① 提交于 2021-02-07 08:12:31
问题 I've been trying to write a script that would potentially scrape the list of usernames off the comments section on a defined YouTube video and paste those usernames onto a .csv file. Here's the script : from selenium import webdriver import time import csv from selenium.webdriver.common.keys import Keys from bs4 import BeautifulSoup as soup driver=webdriver.Chrome() driver.get('https://www.youtube.com/watch?v=VIDEOURL') time.sleep(5) driver.execute_script("window.scrollTo(0, 500)") time.sleep

Match unescaped quotes in quoted csv

空扰寡人 提交于 2021-02-07 07:38:59
问题 I've looked at several of the Stack Overflow posts with similar titles, and none of the accepted answers have done the trick for me. I have a CSV file where each "cell" of data is delimited by a comma and is quoted (including numbers). Each line ends with a new line character. Some text "cells" have quotation marks in them, and I want to use regex to find these, so that I can escape them properly. Example line: "0","0.23432","234.232342","data here dsfsd hfsdf","3/1/2016",,"etc","E 60"","AD"8

Commas and $ in datatable columns

蓝咒 提交于 2021-02-07 07:34:40
问题 I have a datatable with 4 columns that hold currency. Currently I'm treating them as normal columns and manually appending '$' to each value. Now I need to format the column to have commas as well. Is there any plug-in to do this? I also want to remove the manual addition of '$' value. I checked few sites, but I really didn't understand how they work. 回答1: [Updating answer to use DataTables 1.9+ and to honor rynop's better answer. Original answer preserved below the horizontal rule, but it's