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

2
votes
0answers
8 views

csview: A tiny utility to view csv files

Seeing a csv in table form is nicer then viewing it as row text, for example the csv from Calculate food company sales for the year (with headers added by me) looks much nicer in this table form than ...
7
votes
2answers
48 views

Calculate food company sales for the year

I am working on a Python project where a food processing company is trying to calculate its total sales for the year. Python has to read from a text file where its divided into for categories split by ...
0
votes
0answers
18 views

Importing CSV data into DynamoDB using Python

This is my first time working with DynamoDB and I was wondering if what I did is a good way to extract data from a CSV document into DynamoDB. All input is appreciated. ...
6
votes
3answers
203 views

Loading tab-separated tweet data into an array

I'm working on this school project and was wondering if there was any way of storing this information better, faster, more professionally. I'm also restricted to only using an array; don't ask me we ...
1
vote
2answers
76 views

Maths quiz that read/writes CSV files [on hold]

Could this code possibly be shortened, or even better be rewritten in the fewest lines of code possible? ...
4
votes
3answers
95 views

Write data from database to a csv file

I have a database containing a high amount of data. I want my app to filter and select only some of it. And save it into a CSV file or JSON. For the moment I have this method which take the data from ...
1
vote
1answer
38 views

A Dynamic CSV Serializer

I made a dynamic CSV serializer as a learning challenge a while back, I'm hoping to get my code picked apart so I can learn what I can do better. This is a bit long, so I wouldn't expect anyone to ...
1
vote
2answers
42 views

Replacing data in a .csv file

The code works well and does what I intend for it to do. In essence, it opens a file referenced as 'resource'. This is a .csv file. I then searches for the keys in the dictionary and for each key that ...
3
votes
1answer
48 views

Creating a table within a .csv file

I recently made a post on Code Review entitled Writing lists to .csv file. I found the feedback extremely helpful, and wished to provide a continuation of that particular topic; of working with Python ...
1
vote
1answer
20 views

Writing a Counter object to a CSV-file in Python 3

In Python 3.4, a Counter object called cnt like this: Counter({'0200': 3, '3000': 2, '3011': 2, '0210': 1, '4000': 1}) is ...
3
votes
2answers
51 views

Compare lines in 2 text files with different numbers of fields

This is the (hopefully) final version of my script for my file comparison problem mentioned previously in two posts on Stack Overflow (here and here). I have come up with the code shown below, which ...
2
votes
0answers
133 views

Opening the same CSV file in two different ways in order to transform data in one column and update original CSV using Python

I have the following functions and accompanying script. The purpose of these is is to extract XML data from one CSV column (one XML document for each row), and then transform it into a dictionary ...
5
votes
1answer
69 views

Query AD and build CSV based on certain user object properties

My question is about code efficiency. I recently had to write a Powershell 3.0 script which had the following criteria: It had to pull all enabled user objects from active directory It had to pull ...
7
votes
3answers
47 views

Accessing files in a child directory in Python 2.7.x

I have written the below script for use in Python 2.7.x. In essence, I want the script to access a folder contained within the directory the script is and then add all files contained within to a ...
7
votes
1answer
100 views

Writing lists to .csv file

I'm teaching myself programming, using Python as my initial weapon of choice. I have learnt a few basics and decided to set myself the challenge of asking the user for a list of names, adding the ...
6
votes
1answer
34 views

Convert data back-and-forth between CSV files and pretty-print

I wrote a script to convert CSV files in human readable format and vice versa. Human readable format is achieved like so: ...
8
votes
2answers
54 views

Iterate list to map entries in Python

I have two files, namely: File1: CL1 AA XX YY ZZ SS \n CL2 3_b AA File2: AA string1 AA string2 3_b string3 My ...
12
votes
3answers
581 views

Retrieving a csv header

I have two seperate calls that returns a .csv file. I need to extract a couple of headers from the files depending on which one is called. The headers does not always sit in the same index, and the ...
7
votes
3answers
145 views

MP3 Vote Collator - Final

Here is the completed code for my first Python project, for which I received some help and feedback here: Collate votes on MP3 files to list them by popularity Seeing as there have been considerable ...
8
votes
3answers
162 views

Collate votes on MP3 files to list them by popularity

For my first Python project, I decided to create a script that would automatically collate MP3 files into a music countdown. I wanted to 'learn by doing', so I dived straight in and used the Python ...
6
votes
3answers
51 views

Categorizing gene sequences read from a CSV file

I am relatively new to programming and would love to get some feedback on the following section of my code. ...
4
votes
1answer
39 views

Powershell to break apart large flat files (e.g. csv)

I created the below script to help break apart large flat files; to save myself effort opening files which are several gigs in a text editor and manually split them. So far I've only tested on sample ...
7
votes
4answers
218 views

Blocking production lines in Python

I have the following code that works great, but takes 40 mins to 1 hours to finish the task. It has at least 30 rules for blocking lines, and 30k+ orders to check. I'm new to Python (3 months working ...
3
votes
2answers
103 views

Python code to encrypt and email PDF file using PyPDF2

This is my first programming project with real world application. It's purpose is to take a file from a directory, encrypt it with a predetermined password, and email to appropriate recipient. ID ...
3
votes
1answer
95 views

Finding nearest float values corresponding to a data point (of three variables) in a table with multiple columns using C++

I have a data file which contains floating point data arranged in 4 columns. Each row represent a specific data point. The first column(X) is made up of 100 different values but the values are ...
1
vote
1answer
31 views

Computing sums in some CSV files horizontally and in other CSV files vertically

I'd like to eliminate the code duplication in the following two methods by moving the common code into a separate method callable by both. The comments indicate the blocks of code that have a ...
3
votes
3answers
336 views

Merging two files into one .CSV

I'm relatively new to Python scripting. I made a script that takes two raw data files and merges them into one CSV file, but it takes a long time to complete. Are there any logic problems in this ...
0
votes
1answer
31 views

Parsing an uploaded file, returning record of 10 fields for each line [closed]

I have a program that reads a .txt file from a given directory. Each record line contains a data and I am parsing it. I think this is costly with it comes to performance but I might be wrong. Here is ...
3
votes
0answers
38 views

Change an identifier in a .csv file, based on another .csv file

I have only dabbled in Java before (my previous experience being mostly with PHP and JavaScript) but a request come through for a small application that seemed like a good chance to get some ...
2
votes
0answers
59 views

Clean reading of HTML table with R

I have some data under an HTML format and would like to import it in R. However, it seems that type inference is much less sophisticated than what exists with functions such as read.table. I am using ...
3
votes
2answers
40 views

Writing embedded list to CSV in Python

I have a method in a Python app to write a list of records to a CSV file. Each record is a "football player", which is really just a dictionary. But one of the dictionary items contains a list of ...
1
vote
2answers
176 views

Parsing a CSV file in node.js and express.js

I want to import a CSV file and do some operation on it. The following is the code I'm using and it is working fine: ...
3
votes
5answers
281 views

Loading and converting data from CSV

My application imports a CSV file and parses each row, turning it into an object in my code. The speed for a 500,000 row x 68 column takes 2+ minutes to read. I've narrowed down the bottleneck to the ...
2
votes
2answers
84 views

Creating a tuple from a CSV file

I have written code that reads in a CSV file and creates a tuple from all the items in a group. The group ID is in column 1 of the table and the item name is in column 2. The actual datafile is ~500M ...
1
vote
0answers
40 views

Copying csv to sql_table

I wrote code that takes csv and export it to sql table. It looks like this: ...
2
votes
1answer
40 views

Determine column averages

I'm trying to write terse Perl code to calculate the average of each column in a file. The file can have >= 1 columns. ...
4
votes
2answers
117 views

Grouping positive & negative reviews and counting the words

Can somebody help me make the code below smarter and free of redundancy? The code does exactly what I want, but I believe there are many redundant loops and arrays. ...
3
votes
4answers
75 views

Using Python to rename multiple csv files in Windows

I need to rename a large list of csv files that are generated from 3 different servers. The files are produced with a date stamp as the extension, which I need to move in each file name to retain the ...
2
votes
2answers
56 views

Processing eBay category list for database import

Although I've been programming a fair while I'm learning Python and would like to know how I can make my code more "Pythonic". I'm have a CSV file of eBay categories, containing the name and numeric ...
0
votes
1answer
32 views

CSV Creation from two tables with URL for user to click on

The code works but with an increase in data it's now slower so needs a tweak so looking for pointers. ...
2
votes
1answer
34 views

Save list over many csv files each with given number of lines

I wrote a little code for outputting to csv. It takes a list object named outtext and saves multiple .csv files. Each csv file contains ...
4
votes
1answer
78 views

Group lines from the CSV file

I have a CSV file which looks like this: ...
2
votes
1answer
51 views

PHP class to represent types of refrigerants

I'm relatively experienced with Java and C++ so picking up PHP wasn't too difficult. I wanted to get some feedback on my first PHP class. There's nothing extremely complicated as of now, but its nice ...
-3
votes
3answers
62 views

Write object data to CSV files [closed]

Does this method follow the rules of objective programming? If not, how can I change it? ...
5
votes
2answers
55 views

Process text file of fulltext articles from news publications

I'm relatively new to programming and have started writing some code for work. This script is something I wrote that I'd like to have someone comment on. Am I doing anything silly, stupid or totally ...
2
votes
0answers
597 views

CSV to JSON conversion in Java

Since I've looked far and wide for a good example of this to no avail, I have created my own using the JSONArray and JSONObject ...
2
votes
3answers
108 views

Read file into list when class is instantiated in Python 2.7

I would like to read a file into a list when I create the class below. Once the list is ready, I would like to access it outside the class in order to process more code based on the list which now ...
7
votes
3answers
257 views

Parsing pipe delimited lines

I am parsing the following line of code via a specific format. Line is: S|111111|87654321|Bar UK|BCreace UK|GBP|24/08/2010| The Format is: ...
3
votes
2answers
51 views

Advanced CSV-to-SQLite converter

I just wrote an advanced CSV parser that translates CSV to SQL(SQLite Compatible) statements, which are then inserted into the database. It translates variable names in the CSV to values defined in ...
2
votes
1answer
29 views

Create an array of categories from comma-seperated text input

This code works just fine, but could obviously be more elegantly written. The basic idea is to create an array of categories from a text input. The code splits up the text input by commas to create ...