Category "csv"

String previous last index

Is there a simple way of getting the penultimate delimited substring of a string? String original = "/1/6/P_55/T_140"; In this example, the resulting substri

Python 'utf-8' codec can't decode byte 0xe0

import re dictionary = dict() for line in open('Group14.csv', encoding="utf8"): line = line.strip() date = re.findall('(\w+\s\w+\s\d+)\s\d+\S\d+\S\d+

Python pandas DataFrame from first and last row of csv

All - I am looking to create a pandas DataFrame from only the first and last lines of a very large csv. The purpose of this exercise is to be able to easily g

How to run XUnit test using data from a CSV file

Is there a way to run a data driven XUnit test using a CSV file as the data source? I've tried Cavity.Data.XUnit, but it's no longer compatible with the newest

jq convert to csv with keys to column rows

I have JSON example like this { "server1": { "dhcp-libs": "12:4.2.5-83.el7.centos.1", "perl-Time-Local": "1.2300-2.el7", "kbd-legacy": "1.15.5-15.

Python script to read multiple excel files in one directory and convert them to .csv files in another directory

I am relatively new to python and Stackoverflow but hoping anyone can shed some light of my current problem. I have a python script that takes excel files (.xls

TextFieldParser ignoring header row C#

Reading in CSV files and the TextFieldParser skips the header row. Any idea how to make certain the first row is skipped. String[] Col3Value = new string[40];

Python - String.split() using delimiter ',', but there is price in string also using comma in thousand

I am trying to use Python to parse a CSV file. I have a string like this: "11/11/14","Buy","1,900","$10.40","-$19,760.00" I want to parse it to into list

Read separately zipped csv file (.zip .z01 etc) over Python zipfile library

How could we read csv file which is zipped into multiple files? Due to the 4 GB limit of FAT storage format, I have complied csv file into multiple zip files l

Loop not working for urls from csv file

Here, the loop not working, only the first url from the csv file is working.I want to run this for all the urls in the csv file, can anyone help me please... M

jTable saving each row element in the new line in the .txt file

I have a problem with saving the jTable contents to a file. Every row data printed to file makes a new line along. So reading from .txt looks like this: Here

Python3: writing csv files

I'm trying to use Python 3.2 on a Windows computer to write a simple CSV file, however I'm having no luck. From the csv module documentation for Python 3.2: &g

Java - SQLITE_BUSY; database file is locked

My application reads a html table and then a script (TableToCSV) converts it into a .csv format. After that I convert that .csv into a sqlite database. After th

Heroku error when adding an Environment Variable that is a Comma Separated Value with Spaces

Here is a variable that is defined in my local .env file in my app. I created it to be a comma separated value, like so: STATE_KEYWORDS=georgia,new york,new j

MySql Error 1261: Row 1 doesn't contain data for all columns

I am trying to do a load data infile to a database. The only issue I have is I am getting a Error 1261. I was getting an incorrect datetime value error earlier

convert csv file to list of dictionaries

I have a csv file col1, col2, col3 1, 2, 3 4, 5, 6 I want to create a list of dictionary from this csv. output as : a= [{'col1':1, 'col2':2, 'col3':3}, {'

Using CSVHelper to output stream to browser

I'm trying to use CSVHelper to generate a CSV file and send it back to a browser, so the user can select a save location and filename and save the data. The w

How do I request a zipfile, extract it, then create pandas dataframes from the csv files?

Load in these CSV files from the Sean Lahman's Baseball Database. For this assignment, we will use the 'Salaries.csv' and 'Teams.csv' tables. Read these tables

Python BeautifulSoup Empty Rows in CSV File

I am working on a scraper to pull street names and zip codes from a site and all of that is working great and it builds a CSV file just fine for me. But when I

Consolidating two scripts into one new one (appending columns to csv)

I have two scripts which create new columns within a csv, each of them opening the csv and appending a new column. Ideally rather than saving csv to csv1 then o