A comma-separated values (CSV) file stores tabular data (numbers and text) as plain text, with rows and columns delimited by line terminators and commas, respectively. You may also use this tag for variants where fields are separated by tabs or semicolons.

learn more… | top users | synonyms

-3
votes
0answers
21 views

Taking information from SQL database and CSV/ DAT and updating database [on hold]

I drafted up a piece of Python code late last night, and ran it - without any errors! Besides thinking I needed sleep, I thought it was unusual, and I thought I'd just ask, is this piece of code doing ...
3
votes
1answer
76 views

Read from csv file, transform to dictionnary

First of all, here's the code I'm working on: ...
2
votes
2answers
72 views

Concatenating rows in CSV files and removing old CSV files

I have written my first Python script that will go into live use at my workplace. I am relatively new to Python and I think this script is pretty good but I would like your input. It runs very fast, ...
3
votes
1answer
55 views

Read CSV with 3 columns and group some elements

I have a csv with 3 columns (date, name, number) and it is about 20K rows long. I want to create a dictionary keyed by date whose value is a dictionary of ...
2
votes
1answer
28 views

AD update from CSV

I get a CSV dump of all employee records from our payroll system once a week. The CSV has something like 28K records. The key between the two systems is the ...
11
votes
2answers
153 views

CSV reader using StreamReader and LINQ

Mostly due to readability, I am using the following code to find a specific csv file on a drive read that CSV file using a streamReader parse it into a ...
2
votes
1answer
158 views

Slow Python text-processing script

This script of mine merges columns 1 and 2 from one input file and sees if these merged combinations exist in the other infile (and vice versa). I know I get stuck in appending. It did not get past ...
0
votes
0answers
47 views

Speeding up filtering function in Pandas

I have a CSV file with 400 000 rows and the following headers: ...
2
votes
1answer
39 views

A module to display, update and save a dictionary as .csv v2.0

I'd like feedback on my revised code after my previous question. The goal is to create a module which can display, update, save dictionaries as .csv files. I'll use this in another program to update ...
3
votes
3answers
170 views

A program to display, update and save a dictionary as .csv

I'm now looking for feedback on v2.0 of this program instead. I'd like some feedback about my code. What bad habits do I have? What advice could help me write more Pythonic? I'm trying to write a ...
1
vote
1answer
42 views

Processing Excel files of a predefined template to generate output CSV files of another predefined template

I'm a freelancer and I recently wrote a python script that processes input xlsx files that contain data in a particular format and output a csv file in another format as required. The code works well ...
4
votes
0answers
48 views

Vectorize Fisher's Exact Test

I have two data frames/ lists of data, humanSplit and ratSplit, and they are of the form ...
2
votes
0answers
45 views

Adding file name information to CSV file columns

Is there a simple way to combine the functions of this Powershell script? It would be nice to have it file to one output file instead of several output files. ...
2
votes
2answers
33 views

Creating two output files from two formatted files

I've been working on a project to take data from csv files, re-format it, and display it as charts. I'm working for a company over the summer and when I leave, I would like my code to be ...
1
vote
1answer
68 views

Returning information about the result of a file processing, without using output parameters [closed]

As part of a C# class CsvConverter that converts various file types to CSV, I am designing a private class CsvConversionResult. ...
10
votes
1answer
255 views

Find the peak stock price for each company from CSV data

During the hiring process, a company gave me this test: Q) Consider Share prices for a N number of companies given for each month since year 1990 in a CSV file. Format of the file is as below ...
5
votes
3answers
97 views

CSV demographics analyzer seems to waste memory/move slowly

I'm much more fluent in JS, but I needed to sort a lot of dates, ages, genders, etc. from a tab-delimited text file so I wrote this. Could I get some tips on how to make this more efficient and more ...
3
votes
3answers
219 views

CSV reader (revised)

This is the successor of my previous CSV reader. I implemented quite some useful suggestions. I will give explanation on a few parts: Prefixing constant identifiers with ...
8
votes
5answers
281 views

Convert total minutes into “Hours:minute:seconds” for marathon data

The point of the script below is to read in the 10th column which is the total number of minutes a runner took to finish the marathon and convert it into form of "hours:minutes:seconds". Is there a ...
2
votes
5answers
597 views

CSV reader and parser

I have implemented a CSV reader. I think I did pretty well. Since CSV is a loosely defined format to begin with I decided to allow some malformations, like anything but a delimiter after an enclosed ...
15
votes
5answers
849 views

Parsing CSV to specific format

I've written this code to read CSV files written to a specific format. I would like to gather some feedback on where it could be improved. I'm trying to get into the test driven development ideology ...
6
votes
1answer
113 views

Refactoring Tkinter GUI that reads from and updates csv files, and opens E-Run files

Background My lab administers four computer programs in three separate appointments. At each appointment, the subject does the programs in a pseudo-randomized order. Also, three of the programs have ...
5
votes
1answer
51 views

explode textarea and commas [closed]

Am attempting to recreate a common feature, where a user can type several items in to a textarea, separated by commas and newlines and then submit them, i.e. for multiple record entry. The data does ...
3
votes
1answer
88 views

Converting JDBC to CSV

One of my first ever jython scripts lets me get comma-separated values out of an RDBMS. I submit it here in hopes that you'll rip me apart. Without further ado, have at it: ...
5
votes
3answers
69 views

Command line tools to format tables

I am a big fan of one-liners using sed awk perl and other tools. But there are that are ...
4
votes
2answers
82 views

Improving performances processing compressed csv files

I have some csv files compressed in .bz2 format. I need to take a subset of the records (and data) and switch to .gz. I am not ...
5
votes
1answer
139 views

Finding nearest city from a center place (latitude and longitude) with radius in miles

This is my code for finding the nearest city within a certain radius. I am not sure, is my code is OK or is it wrong? Please review and offer suggestions on my code. ...
5
votes
2answers
960 views

How to optimize for larger files: MemoryError in Python while combining multiple JSON files and outputting as single CSV

I have a number of JSON files to combine and output as a single CSV (to load into R), with each JSON file at about 1.5gb. While doing a trial on 4-5 JSON files at 250MB each, I get the following ...
5
votes
1answer
123 views

String modification application

Below is working code of a semi complete program. Its purpose is to take an input string of any type and modify it based on rules defined for each type. So in this example I pass it a string in CSV ...
4
votes
2answers
81 views

Data screening using Perl

Background information I've been asked to write a little Perl script that allows genomic data to be screened against reference files in order to determine locations of specific mutations. The input ...
4
votes
4answers
81 views

Comparing phone numbers across CSVs Python

(continuation from Speeding up and fixing phone numbers from CSVs with Regex) I'm pulling all of the phone numbers from all CSVs in two different directories, outputting them in a single simple ...
2
votes
2answers
125 views

Speeding up and fixing phone numbers from CSVs with Regex

I've hodgepodged together an attempt to extract all phone numbers from all CSVs in a directory, regardless of where they are and what format they're in. I want all phone numbers to be printed to a ...
1
vote
1answer
287 views

Parse Bloomberg Excel/CSV with Pandas DataFrame

I retrieved Bloomberg data using the Excel API. In the typical fashion, the first row contains tickers in every fourth column, and the second row has the labels Date, PX_LAST, [Empty Column], Date, ...
7
votes
2answers
632 views

Parsing CSV file with BufferedReader vs Scanner

I have to parse file line by line and in single line I have split by ",". First String would be Name and Second would be count. Finaly I have to display the Key and Count For example ...
10
votes
2answers
399 views

Averaging numbers from a file, obeying Single Responsibility Principle

Task: Given comma_separated.txt file with string: 1,2,3,4,5,6,7,8,9,10,11,12...,n Calculate the average ...
0
votes
0answers
146 views

Optimizing a function to read bigger files in php

I have the following function that reads data from a csv file and it is supposed to take in data which is from a certain certain timeinterval in this case 07:59 and saves them up in another csv file. ...
4
votes
1answer
819 views

Printing out JSON data from Twitter as a CSV?

I'm extremely new to Python, and the Twitter API, but I found a example online that walked me through the process. Now that I've been playing around with it for awhile, I've begun to push the limits ...
3
votes
1answer
77 views

Reading messages with binary tree

I'm building a binary tree. Example: key AAAA1.ETR, value 1. I'm reading files with this structure: ...
6
votes
2answers
182 views

Read CSV, compute some stuff and prepare data to be sent to GNUPlot

I would really appreciate some good advice on how to refactor a small app: It basically reads a CSV (energy/heat values?), computes some stuff, and then prepares some data which should later be sent ...
2
votes
2answers
147 views

Updating tables with bulk of data through CSV

My work is pretty simple. I have to migrate a bulk of data into the specified tables, so that the data does show up at the front-end. The data is provided through the ...
5
votes
1answer
326 views

Fastest Way to Write Multiple CSV's

I'm writing a program to process log files. Currently, I have a script that will extract the desired information from each log and put it into a list - I have about nine different lists all ...
4
votes
1answer
89 views

Cutting strings into smaller ones based on specific criteria

So, I've got this largish (for me) script, and I want to see if anybody could tell me if there are any ways to improve it, both in terms of speed, amount of code and the quality of the code. I still ...
3
votes
1answer
390 views

Knn console application; problematic implementation

I'm working on a small command line application in c# where data is read from a CSV file along with a query and KNN is calculated for the query based on the data. My problem isn't the algorithm at ...
3
votes
1answer
70 views

Generating two .csv files from named parameters

I wrote Clojure code which takes named params and has to generate 2 .csv files as output. Please review it. ...
6
votes
1answer
340 views

Speed up CSV reading code (vector of doubles)

I am trying to read a single-columned CSV of doubles into Java with a string header. It is 11 megabytes and takes over 15 minutes to read, which is clearly ...
6
votes
1answer
311 views

Calculate query coverage from BLAST output

I have a BLAST output file and want to calculate query coverage, appending the query lengths as an additional column to the output. Let's say I have 2 7 15 ...
1
vote
1answer
136 views

Grouping a CSV by column

I've started writing a small CSV parser class as I needed a method to group a CSV file by a given column. ...
2
votes
2answers
47 views

Formatting inventory of parts

I have one file with indexes. For example, they are: 1 Fruit 2 Meat 3 Fish 4 Salmon 5 Pork 6 Apple And a dictionary, because I ...
2
votes
0answers
3k views

Reading columns and rows in a .csv file

I have some data in a .csv file, which looks roughly like this: ...
3
votes
2answers
580 views

Reading in a file and performing string manipulation

In a question I answered I posted the following code: ...