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.
1
vote
1answer
24 views
Output a flight schedule, formatted in military time
I have a CVRP problem that I solved in Python. There are 6 planes (T1-T6) and 3 airports (AUS,DAL,HOU). The airports have 1,2,3 gates respectively. Each airport has a minimum ground time of 25, 30, 35 ...
5
votes
3answers
98 views
CSV parser for a tech test
The requirements:
The following was an interview test for a junior position.
You’ve been asked to write a program that will take a dictionary file (csv list of words) and output the number of ...
-3
votes
0answers
27 views
Extracting and modifying administrator accounts listed in a CSV file
I created an automated process for a report that I have to generate every month. The script imports a CSV then filters out the administrators and the operating systems. Then I add a Unique Account ...
3
votes
0answers
27 views
Split CSV into Seperate CSV Files on Parent Row (based on segment count)
I have a csv that is exported from SolidWorks, the input looks like this:
...
3
votes
2answers
61 views
Python Script: Converts .tsv to TFRecord
The python code below converts a tab spaced values file (.tsv) into a TFRecord in hopes that this approach expedites future time spent loading the data. Is the performance of this task correct and ...
-1
votes
0answers
36 views
Deleting multiple rows in csv file by dates
I have a code here to delete multiple rows in csv file by dates and not including the modified date range. Just to review this code how it will recognized the string as a valid DateTime.
...
3
votes
0answers
43 views
Powershell script that reads Outlook emails and exports results as .csv
I wrote my first powershell script. It reads through all the emails in a folder and exports some of the data as a csv file. I'm happy with the way it works but I plan to share it with co-workers, so ...
3
votes
1answer
49 views
Filtering and processing computers listed in a CSV file
I am trying to make my script run a lot faster. I have a csv that has about 330k of lines on it that I plan on running my script with and it has been taking an extremely long time. I just did ran the ...
5
votes
4answers
84 views
Finding students with the best grades in a given subject
We have a school assignment, in which the program is to read data of students from stdin, in the following format: LASTNAME FIRSTNAME STUDENT_ID SUBJECT AVERAGE_GRADES. The program has to print out ...
3
votes
1answer
51 views
Read CSV files and find the same values on the specific columns
I created a simple command line application to read CSV files in a specific folder and find the same values on the specify column which exists on all files. (Here's the complete source code.)
Here's ...
9
votes
2answers
103 views
In memory data access for CSV files that may have changed
I'm reading data from CSV files and store the result in a simple DataContext instance that gets injected throughout my application.
...
4
votes
1answer
82 views
Mapping a CSV with UTF-8 encoding to JSON in Python
I'm not a programmer, just a guy who needs to solve particular things using code.
I needed to create a JSON from a CSV with predefined headers. I'm downloading an attachment from JIRA (REST API), ...
3
votes
1answer
46 views
CSV Splitter in Bash
I am splitting a csv file where the first 3 columns will be common for all the output files.
input file:
...
0
votes
1answer
31 views
Generates a CSV output of dummy data
I have written a quick piece of Java code to create some CSV data. The code simply outputs all of the permutations of specified lists of values and gives each row a unique value.
I want to know if ...
7
votes
2answers
94 views
Append blank value(s) to missing fields in a CSV line
I have a small app that takes in CSV files. It reads the CSV file and before it inserts a line into the DB it checks certain conditions on the line.
Now, let's say the length of the line should be 5.
...
4
votes
1answer
49 views
Create SQL statements from CSV file for creating a MySQL table
This program reads in a CSV file's header row and writes out SQL statements to a .sql file that can be used to create a new table in a MySQL database and load the data into it. If anyone can offer ...
2
votes
1answer
58 views
Many CSVs to list, optimize
I have a Python3 script (running on Python 3.5.2) which reads 110 CSV files (tab delimited) into a list. The largest file is 20 MB and the list ends up looking like this:
...
2
votes
2answers
153 views
Mapping .csv rows to a Dictionary
I have a .csv file in which each row represents an association between a software application and a web server. My goal is to fetch a List<Server> by ...
3
votes
2answers
53 views
Loading CSV into MySQL using OOP PHP
I need to make a simple CSV->MySQL script in OOP and I was wondering if there's anything I am doing wrong in a object-oriented sense.
I have a file name db.php where I connect to MySQL via MySQLi and ...
3
votes
2answers
85 views
Read numeric data from a text file using C++
I need to read Numeric Data from a text file that looks like this:
2
cell X-cord Y-cord
1 1.1 2.2
2 2.1 2.0
The first line indicates the dimension (...
3
votes
2answers
61 views
Extracting data from database to CSV
I have a feature for users to be able to export the database information. But if the user choose all options to export it takes 1 minute or more to download the .csv file. I'm only including 1 part of ...
5
votes
2answers
171 views
Validating a CSV list of contacts and convert it to JSON - Follow Up
This is a follow up to my original post:
I've written a class that takes a file, validates the formatting of the lines from an input file and writes the set of valid lines to an output file. Each ...
3
votes
1answer
39 views
Python command-line program to convert genomic data file
Background:
I have written this code to transforme a .csv file exported from a software called Geneious containing SNPs and concatenate them into a DNA sequence.
So basically take fields from .csv ...
5
votes
4answers
684 views
Convert XML to CSV
I'm pretty sure this code can be optimized, but I'm not talented enough in Linq to do it myself. Here's what I'm trying to do: I have an XML file that needs to be converted into a .csv file. The XML ...
3
votes
2answers
70 views
Validating a CSV list of contacts and convert it to JSON
I've written a class that takes a file, validates the formatting of the lines from an input file and writes the set of valid lines to an output file. Each line of the file should have a first name, ...
7
votes
1answer
162 views
Football game simulation
I'm working on a text-based football simulation game along the lines of Football Simulator. Below is a subset of my total code, specifically the functions used to create a new player. I also have ...
5
votes
2answers
88 views
Python code to split csv into smaller csvs, not splitting IDs
I have Python code that splits a given large csv into smaller csvs. This large CSV has an ID column (column 1), which consecutive entries in the csv can share. The large csv might look something like ...
2
votes
1answer
140 views
Reading multiple CSV files and asynchronously update SQLite
My console app needs to read several big CSV files to update its data, which are stored in a SQLite database. I am new to C# and would like to know if there are ways to improve this sample code I ...
0
votes
2answers
68 views
Best way to get the best performance of a large CSV upload in PHP
I am trying to upload a CSV file to a database which has around 800,000 rows. I am able to do this on my server with the following specs:
RAM: 4GB
Rows: 800,000
Time taken: 305 seconds
Usage: 15% RAM
...
5
votes
1answer
40 views
Read CSV into 2D float array in Go
Depending on how you count, this is my first Go program. I'm trying to read a CSV into a two-dimensional array of some numeric type, and then print it out.
(I want to use this to read "edge weights" ...
3
votes
1answer
60 views
Delete lines from a CSV file that contain fields listed in a text file
I wrote a powershell script to compare words from a text-file with a csv-column. If the word in the column matches, the line is deleted.
...
6
votes
1answer
66 views
Counting weather events for visualization using Gnuplot
I wrote this code to analyze ~800 MB of weather data from the US. I am planning on visualizing the data with Gnuplot and Gimp. I have already made the images and a gif file. This code runs somewhat ...
3
votes
3answers
59 views
Displaying a leader board from a text file and calculating points
The text file is laid out like this: first name, last name, wins, losses
dex,kop,5,6
desder,jok,0,11
aslan,vert,11,0
jax,sas,2,9
buy,guy,1,10
Code:
...
5
votes
1answer
25 views
Find the maximum line length in a given TSV colum
I'm trying to write a function that given a TSV file will get the maximum line length found in a column. I currently have this (working) function. However, I feel that I am missing something as this ...
4
votes
5answers
167 views
Simple class to create csv
As part of a solution I have the following class createCSV. It is working as expected but I'm very much aware of my lack of experience with ...
4
votes
1answer
157 views
Login program in Python
I wrote this login program as part of my project for school. Should I use my implementation of a login program, or is there some standardized patterns of login programs, like the ones in encryption ...
6
votes
2answers
1k views
Reading large amount of player properties from CSV
I have written a class with a function that reads out the CSV from the webpage and creates an object with it.
The class seems too big - it seems very unoptimized, prone to mistakes and it's not very ...
3
votes
1answer
216 views
Calculate stock portfolio profit based on CSV data
import time
import csv
import argparse
from nsetools import Nse
from colorama import Fore
nse = Nse()
t = time.time()
CSV file contains the following data, I ...
5
votes
1answer
97 views
Simple query language for CSV files
I'm struggling to improve this command-line java application, which reads CSV or txt files, ands allows the user do some "queries" with the data. I can't use any external library, so I'm doing it all ...
7
votes
1answer
115 views
Efficiently adding huge amounts of data from CSV files into an SQLite DB in Java
I'm trying to parse values from a CSV file to a SQLite DB, however the file is quite large (~2,500,000 lines). I ran my program for a few hours, printing where it was up to, but by my calculation, the ...
0
votes
1answer
217 views
Searching a CSV with PHP
Given a string, I've done the below to search a CSV for a keyword and display the row if it's found
...
1
vote
2answers
2k views
Finding the states with the three most populous counties
I just started to use Python and Pandas. My current solution to a problem looks ugly and inefficient. I would like to know how to improve it. Data file is Census 2010 can be viewed here
Question:
...
5
votes
1answer
53 views
Plotting some displays from a weather URL
I've got some code that plots some displays from a weather URL and locations in a CSV file. I'd like to see if anyone can make the code more efficient, the code runs fine without any errors and I'm ...
11
votes
4answers
2k views
Country code lookup for each line in a CSV file
I'm trying to write a program that has a for loop, inside of which I have lambda expression to get a certain value. The loop has about 20,000 iterations. Including ...
4
votes
1answer
140 views
java class to read csv files
Here is my class to read a csv file and I was wondering if there is any improvements that I should do. I feel there are some performance improvements or in exception handling because I just took IO ...
4
votes
1answer
478 views
Writing CSV file from huge JSON data
I am writing a program that reads from DB and outputs to a CSV file. Besides the regular columnar data there are 2 JSON fields data as well. The table layout looks like this (other fields removed for ...
4
votes
0answers
77 views
PowerShell Export-CSV with Cultural Awareness
I recently had a requirement to export data to CSV in a different culture & hit an issue (see https://stackoverflow.com/a/40871162/361842).
Here's my workaround:
...
5
votes
1answer
106 views
Frequency analysis for counting keywords
I have a CSV with around 10,000,000 lines. Each line looks like:
...
2
votes
1answer
61 views
Multiple files data processing in Clojure
I have made a small script which grabs data into a map from 80 CSV files and calculates some statistics like average, standard deviation etc. It's also adding some additional data to map from filename....
3
votes
3answers
74 views
Converting a text file to a CSV file
I'm attempting to learn more about Java and have created a method that takes a text file with stdout (space separated file) and converts it to a CSV file.
I was ...