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.
3
votes
1answer
46 views
Extracting coordinates file that are inside a bounding box
I'm scanning a CSV file to see which values fit inside of a given box. The CSV file has X and Y coordinates, and the arguments to the function are the perimeters of a box (i.e, top, bottom, left side, ...
1
vote
2answers
47 views
Reading CSV files and inserting in a SQL database in VB.Net
This program reads all files in a folder and subfolders line by line, converts them in a supported character set, replaces all unsupported characters and inserts them in a SQL database. My idea was to ...
3
votes
2answers
32 views
Combining values corresponding to the same key
What the following code does is:
The key field is column0 (where sometimes there could be single key, and sometimes keys separated by comma).
The rest of the columns are also either single or comma ...
1
vote
1answer
55 views
Golang: reading and processing a big csv file
I am quite new to Golang. I am trying to write a script to read a CSV file containing 1 million domain names, lookup these domain names and store the results in another CSV file. I am trying the ...
4
votes
1answer
42 views
Saves Scores of an Arithmetic Quiz
This code is part of a larger code that generates an Arithmetic Quiz, although the code I have show below just saves the score that the user got on the test and their name. When saving the code it ...
-1
votes
1answer
62 views
Displaying membership information
The code is about displaying membership information of all clients from a database. This is for homework and I'm just curious if more can be done to improve this. Feel free to alter it, but please ...
6
votes
2answers
60 views
Comparing vehicle crash data the previous year
I have created an automated macro which takes vehicle crash data from a .csv file and automatically creates a pivot table and charts and compares it to the previous year. The code is approximately ...
3
votes
2answers
88 views
Displaying member information from a CSV file
The code is about displaying membership information of all clients from database. I was just wondering what I could do to improve/change it.
...
1
vote
2answers
60 views
Write into the same CSV file multiple times
I implemented an OutputWriterService.class to write content in the same file multiple times.
The writeToCsvFile method is ...
1
vote
0answers
23 views
Bulk customer creation
Here is my script which takes 50k records from a CSV and does CRUD operation with them. Unfortunately there are a lot of issues with the performance.
CSV fields are: msisdn, resellerid, product
...
2
votes
1answer
52 views
Update record with CSV
I'm using Rails 4.2.5, and I'd like to update existing records with a csv file with two fields: id,category. Where if the category field is blank, it defaults to misc.
Here's an example csv file:
...
-1
votes
1answer
39 views
Replacing address details in colon delimited string
I'm sanitising personal data in a large database with a series of Regular Expressions. In many cases the sensitive data is in a colon-delimited field within a CSV file.
Here is a sample:
...
1
vote
1answer
45 views
Python CSV reader
I have a function that pulls data from a file or string literal in my case and returns them in either a list or a dict.
My ...
4
votes
2answers
97 views
Parsing a string as fast as possible that is using comma delimiters
I have made a simple static parser for a bigger program. This parser takes a string that has comma deliminators and I need to separate the strings in to a vector for handling in a different section of ...
5
votes
1answer
78 views
Summing chemical properties in a CSV stream
I have written my first program in go. It's rewritten from python.
Program takes csv file, emulates query ...
3
votes
1answer
31 views
Splitting apart a comma separated list
I have a system that outputs a comma separated string into a single column. I need to grab the individual values out of that list. The list could have random spaces and commas that need to be ...
1
vote
0answers
50 views
A command line Java program for computing grade point average - follow-up
(See the previous and initial iteration.)
I have refactored the API based on excellent review by cbojar. Also, a honorary mention goes to janos for pruning some unnecessary code out of the transcript ...
7
votes
3answers
93 views
A command line Java program for computing grade point average
(See the next iteration.)
I have this command line program for computing GPA (grade point average). Given credit sequence \$\langle c_1, c_2, \dots, c_n \rangle\$ and grade sequence \$\langle g_1, ...
0
votes
2answers
46 views
3
votes
1answer
140 views
Arithmetic quiz with class database and score analysis
I have done this quiz project and I have tried as hard as I could when I was writing to make it user friendly to read. Could you help me on improving and making it more user friendly please.
...
0
votes
1answer
65 views
csv loader and kNN algorithm in Java
I have applied the KNN algorithm for classifying handwritten digits. the digits are in vector format initially 8*8, and stretched to form a vector 1*64..
As it stands my code applies the kNN ...
1
vote
1answer
62 views
Reading a CSV file containing a dataset of 8×8 images
I am trying to implement a machine learning algorithm (k-nn for example). But before I attempt to do that I was hoping for some feedback on my current Main class, which essentially builds 8×8-pixel ...
1
vote
1answer
49 views
Find csv item index
I'm quite new to Python and I have been trying to find a way to search a csv for a test string and return the index of that item in the csv.
I am using the code below but find it hard to believe that ...
3
votes
1answer
113 views
Joining huge CSV files and splitting the result into batches
I've got ~20GB of data about the same subject, concatenated from small files of 16kB, each produced by different measurement equipment. They share some headers (on the example: B, D & E) and they ...
3
votes
0answers
66 views
Python Script to query OSRM (drive-times)
The below script takes two arguments
Path to the OSRM Map
Path to a .csv containing the columns ...
25
votes
5answers
3k views
Performance of a Foreach inside a Foreach iterating through a million records
I have two DataTables:
dt: is populated from a CSV file with over 1.7 million rows
dataStructure.Tables["AccountData"]: is ...
3
votes
1answer
58 views
Reducing memory footprint when manipulating big csv file
I have CSV file which has structure like this (separated by tabulators):
...
8
votes
1answer
110 views
RFC 4180-compliant CSV parser in Java
While looking at a recent question, I realized that there is no CSV parser in the standard Java library. I decided to write one that complies with RFC 4180. Highlights of the standard include:
...
2
votes
1answer
71 views
Student data parsing application
My application takes a .csv (comma separated values) file and serializes the data into a binary file. Then it converts the binary file back to a .csv file (identical to the original file).
For ...
2
votes
2answers
60 views
4
votes
3answers
44 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
85 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 ...
6
votes
3answers
234 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
213 views
Maths quiz that read/writes CSV files [closed]
Could this code possibly be shortened, or even better be rewritten in the fewest lines of code possible?
...
4
votes
3answers
130 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 takes the data ...
2
votes
1answer
103 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
54 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
57 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
48 views
Writing a Counter object to a CSV-file in Python 3
In Python 3.4, a Counter object called cnt like this:
...
3
votes
2answers
71 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 ...
1
vote
0answers
141 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
160 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
59 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
129 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
50 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
60 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
586 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
147 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
171 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
63 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.
...