Questions tagged [csv]

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.

Filter by
Sorted by
Tagged with
2
votes
1answer
96 views

The fastest way to import and edit data in R

So I want to import and edit a huge amount of data. I have a file with multiple data sets from time series that are chronologically ordered. Now I want to open them and edit to have a final dataset ...
1
vote
1answer
7k views

Split data from single CSV file into several CSV files by column value

Okay...so I have been self teaching for about seven months, this past week someone in accounting at work said that it'd be nice if she could get reports split up....so I made that my first program ...
3
votes
1answer
1k views

Download and write ~100k images

Currently I will be downloading around ~100K images. This process may run on a weekly basis, I'm considering the following factors: HTTP Requests (Will be taken care by external LB, so same source IP ...
5
votes
0answers
647 views

Converting multiple excel files in multiple folders into CSV

The whole project is quite large, involving parsing the CSV-files, validating them, exporting them to a database and such, but my code in question involves subset of the project: converting multiple ...
1
vote
1answer
193 views

Crawler for performing reverse search and writing results into a CSV file

I've written a script which is able to perform reverse search in the website using the Name and Lid from a predefined CSV file. However, when the search is done then it can put the results containing ...
3
votes
0answers
178 views

Scrape a stock value and add it to a csv file along with other data. [Python 3]

Any and all suggestions are welcome, mainly looking for suggestions on clean up, and making it more readable as I feel that it is inefficient and not very clean. Some specific things: A better way ...
1
vote
1answer
624 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
322 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 words ...
2
votes
0answers
187 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: ...
4
votes
2answers
700 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 ...
3
votes
0answers
8k 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
61 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
99 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 ...
2
votes
1answer
183 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 ...
10
votes
2answers
467 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
3k 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
131 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
48 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
2k 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
2k 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
65 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: ...
4
votes
2answers
7k 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 ...
2
votes
2answers
441 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
770 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
82 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
200 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
62 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 ...
8
votes
4answers
10k 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
170 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, ...
1
vote
1answer
94 views

Setting variables from a text file

I'm new to PHP, having coded in Perl and ColdFusion years ago. In the process of trying to familiarize myself with my new job, I have found some code that would neither seem efficient nor logical, ...
7
votes
1answer
4k 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 ...
6
votes
2answers
2k 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
786 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
3k 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
553 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
2answers
3k 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
99 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
5k 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
189 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 ...
5
votes
5answers
33k 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
4k 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
2k 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
2k 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
2k 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
6k 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 ...
4
votes
3answers
20k 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
72 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 ...
5
votes
2answers
2k 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 ...

1
3 4
5
6 7
12