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
0 answers
148 views

Can the k-index in either of the two individual locations be used to predict the estimated kp-index?

The k-index measures the condition of the magnetosphere. It is usually averaged over three hour, so each day has 8 measurements. The planetary k-index (kp-index) is an average of the measures taken ...
S. M.'s user avatar
  • 201
1 vote
1 answer
46 views

Process comma separated input and check format

I have to read console input and store data in the vector of structs. In case of any data format violation I have to print "Malformed Input" and return <...
mascai's user avatar
  • 375
1 vote
0 answers
388 views

DB2 SQL statement to split a string based on delimiter

I have a "flat file" with structure as below: ...
Theju112's user avatar
7 votes
4 answers
1k views

Calculate average values for each day of the week for each Meter

I have a program with these two methods. One method to import a set of data from a CSV within the given time period and store them in a dictionary. Here the data in CSV file is stored in following ...
HARINDA VITHANA's user avatar
2 votes
1 answer
105 views

Remove unwanted chars from CSV header as it's being read

In trying to answer this question on StackOverflow about using the gocarina/gocsv package to read a CSV with a header column name that has a comma, I got to thinking about how to preprocess the first ...
Zach Young's user avatar
2 votes
4 answers
466 views

CSV to list, map to database

I have a code block that imports CSV to list and map to a database. And there are few validations and I've to return error messages based on those validations. Right now all those logic is handled by ...
Optimus's user avatar
  • 131
6 votes
2 answers
1k views

Read a large CSV order book

I am trying to read entries of my CSV file into an entries vector whose data type is object OrderBookEntry, which is an object that stores the tokenized variables ...
Beginner_coder's user avatar
3 votes
0 answers
48 views

song guessing game with hashing

I have created a CLI python game that allows for the creation of local accounts and the data is stored in local .csv files. The passwords are hashed so can be stored securely. It keeps track of the ...
excal.rs's user avatar
3 votes
1 answer
655 views

Read a large compressed CSV file and aggregate/process rows by field

I have as input a potentially large CSV file (gzip compressed) with a known structure. I don't know in advance the size of this file, but let's say it can't fit in memory. The rows in this CSV are ...
revy's user avatar
  • 133
3 votes
2 answers
139 views

Saving Scraped Data to a File

When scraping and saving data into a file, Which method is more efficient when saving scraped data to a file? open the file first, scrape, and save the data all ...
Seraph776's user avatar
  • 191
3 votes
2 answers
617 views

Transform dict of lists to CSV

I want to transform this dict to CSV: ...
Rohan Kishibe's user avatar
4 votes
1 answer
982 views

Translate SOAP response into a CSV using Python

I have this XML from a SOAP call: ...
Nick M's user avatar
  • 43
3 votes
1 answer
120 views

My first rust program: transposing a CSV

Here's the result: ...
HolKann's user avatar
  • 131
5 votes
2 answers
529 views

CSV to TSV converter in C+yacc+lex and a Makefile

This is Comma-Separated Values to Tab-Separated Values converter written in C, with yacc(1) and lex(1). I'm remembering how to use yacc (the first (and last) time I used it was while reading «The UNIX ...
CancelVanDePaar's user avatar
4 votes
2 answers
186 views

Read a file format with mixed CSV and non-CSV content

I have a file format that I need to read which contains blocks of CSV data interspersed by non-CSV (or at least, inconsistent CSV) lines. Other than the very first line of the file (which has comma-...
Ajean's user avatar
  • 263
4 votes
3 answers
355 views

Analyzing baby name data in CSV files

First time using code review. I am still a student so there will be a lot to be desired. Basically as part of the homework we are told what methods to create (Method names are given with their ...
NotReallyOliverTwist's user avatar
5 votes
2 answers
681 views

CSV file parser with some checks for header fields and duplicate rows

I have built a sample Parser class on top of the csv module for basic checks that we normally need as the first step of pre-processing. I would love a bit of feedback on the code and any areas that I ...
SDRJ's user avatar
  • 161
3 votes
1 answer
135 views

Fetch CSV file into PANDAS and send report of Spotify statistics

I'm relatively new and self taught in Python. I've written this code which gets a CSV file from a website, plays around with the data then creates an email with information gleaned. I know this is too ...
rossf's user avatar
  • 33
0 votes
1 answer
279 views

Sorting nested dictionary by price - without extra memory

I am working on parsing an orders.csv file with products and prices by different vendors which is kind of a time-series data. The output of that process looks something like below, with order total by ...
Prashanth kumar's user avatar
2 votes
2 answers
970 views

Create csv file for each id value and write all data rows to csv with same id

I have a text file which is tab delimited: 1 324 2344 1 8372 1234 2 62 12 2 872 12111 2 1211 28736 3 87636 198272 The first &...
jim's user avatar
  • 23
2 votes
0 answers
106 views

CSV file aggregator (appender) CLI

My goal is to write a CLI utility that aggregate (appends) many CSV files in a lightweight and performant (my use-case involves output files in the 10s of GBs) manner. Specifically, the utility ...
Luke Carr's user avatar
  • 223
1 vote
2 answers
935 views

Create an ASCII table from CSV

The following code convert csv to ascii table. ...
Ahmad Ismail's user avatar
1 vote
2 answers
1k views

Take every second row in CSV file, and put it next to the previous row

I have a csv file ...
Bogdan Mind's user avatar
4 votes
3 answers
177 views

Add missing business days in CSV file

I need to fill missing business days (i.e. any days except saturday and sunday) in a series. So let's say I have this array: ...
oderfla's user avatar
  • 163
2 votes
3 answers
217 views

Abstraction for CSV files

I made a CSV class which manages CSV files. Is this good?, I'm beginner btw. It's probably bad but can you give me some tips! Header file: ...
ihsan's user avatar
  • 153
1 vote
1 answer
337 views

How to speed up the search by patterns matching and modifying a DataFrame

I need to classify URLs from a DataFrame and modify it by exact match and contains conditions: ...
drkwng's user avatar
  • 25
2 votes
2 answers
667 views

C++ Minimal CSV parser

I wrote a minimal CSV parser for my machine learning toy project. ...
frozenca's user avatar
  • 1,683
2 votes
1 answer
328 views

Simple lightweight CSV reader in C++

My coding background is mostly from C and I've noticed that I tend to "use C++ as it was C" quite a lot. So this is a very small project I've written to improve my understanding of best ...
Smurker's user avatar
  • 123
5 votes
1 answer
1k views

Reading a CSV file using Haskell

I'm reading a CSV using Haskell. I'm not sure if this is the appropriate way to do it. This is what I'm doing: Read rows from a CSV -> return lazy byte string Parse the headers and rows from the ...
Julian Espinel's user avatar
1 vote
1 answer
689 views

Writing data to CSV, checking for duplicates

I am writing a program that takes user input and writes it to a CSV file. I am also checking to see if what they have input is a duplicate of whatever is in that CSV file. So far, the flow of this ...
theonetrue2's user avatar
3 votes
1 answer
269 views

Reducing the amount of duplicated code (python) - cricket matches [closed]

I'm a beginner and self taught and just want to see if there are neater ways of doing what I am doing, or whether there are bits of code that are poorly written. I think Lines 100-204 are the most ...
Luke Hansford's user avatar
7 votes
1 answer
124 views

GUI that reads data and generates/ saves charts

I have a program that uses pandas to read csv files and then generates and saves graphical charts. I have been trying to follow the SOLID principles so I have tried to seperate responsibilities. So ...
JudasMoses's user avatar
2 votes
1 answer
343 views

Calculate students' GPAs and sort them, based on two CSV input files

Problem: Given two csv files science_courses.csv and other_courses.csv, which has students name and their respective course ...
dm90's user avatar
  • 173
-2 votes
1 answer
956 views

Java: Is there an easy way to append a new column that will be having same value for all rows in csv? [closed]

I am processing a file as the following and closing it. Later, I do some more processing and get some ID that I want to append to all rows in the previous CSV generated. So all rows will have the same ...
Atihska's user avatar
  • 97
1 vote
2 answers
71 views

Python script for parsing and using CSV data

I am given a CSV file of stations, with data like this: ...
Lucky's user avatar
  • 111
4 votes
1 answer
641 views

Basic CSV Parser in C++

This was written down solely as a mean to practice basic C++ and isn't meant to serve any production purposes. Clearly, the implementation can't handle all input formats: it always expects the CSV to ...
Pavel Gurkov's user avatar
3 votes
1 answer
863 views

Mapping CSV columns

I have the following code where I am trying to map columns from the input file to output. I have written it using multiple loops. Is there a way to write this more efficiently? input.csv: ...
pythonicwiz's user avatar
0 votes
1 answer
130 views

Compare hostnames and leases between CSV and DHCP info

I have 3 nested loops and they do the following: Get scopes from DHCP Get hostnames from csv file Compares hostnames and leases, matches are added to a hash table There are 5 DHCP servers, 100's of ...
feelsgood's user avatar
2 votes
0 answers
58 views

Open and update csv file

...
jp0514's user avatar
  • 21
3 votes
1 answer
108 views

Manipulating Pandas Dataframe with vaccination data from CSV to display on matplotlib

I have some code that manipulates a Pandas Dataframe containing Covid-19 vaccine data and displays it on Matplotlib. The data is here: https://covid.ourworldindata.org/data/owid-covid-data.csv (...
KetZoomer's user avatar
1 vote
1 answer
90 views

convert .sav SPSS files into long or flat format CSVs

I'm a long standing PHP, JS, C#(Unity) dev looking to get outside objects and lower down. I've written a quick program to read binary data from a .sav file, and output the data section into CSV's in ...
E R Barratt's user avatar
4 votes
2 answers
260 views

Read a csv file and insert into DB table

I've found some resources about PHP performance optimization here and there but I don't know how to start. I send 130k CSV rows in approximatively 7min. My script read CSV file and send ...
Bebert Beberr's user avatar
1 vote
1 answer
1k views

Processing CSV files with filtering

I have 4 CSV files that i need to process (filter out Part segment and then merge them) but the problem is that they do not fit in my memory. So I decided to: [open - filter - write out] each one of ...
amous's user avatar
  • 13
2 votes
1 answer
74 views

Transform Data from JSON and CSV to another JSON format

I have 2 files wholesaler_a.csv ...
Dahab's user avatar
  • 149
1 vote
0 answers
230 views

Command line utility for user data migration from MUBI.com to letterboxd.com

Please make code review for command line utility for user data migration from MUBI.com to letterboxd.com. Utility makes Get HTTP request downloads json-data, parses it and saves as CSV-file. Can be ...
triclosan's user avatar
  • 254
2 votes
1 answer
112 views

Script that makes a rating of movie directors for a user of IMDB

I want to create a script that displays the rating of movie directors for a user on IMDB. After some research, I realized that there is no free API for making such a list. The only option is to export ...
edvard_munch's user avatar
5 votes
2 answers
813 views

Mapping column names and values of a csv using another csv

I have two csv files, pricat.csv which contains objects I need to populate my DB with, and mapping.csv which specifies how the ...
Adamantoisetortoise's user avatar
2 votes
2 answers
5k views

Python script to extract columns from a CSV file

I have a very basic python script that reads a CSV file. I'm importing the csv module setting some empty list variables and getting the data I want. The problem is that I know there is a much more ...
user avatar
2 votes
1 answer
2k views

Java CSV to XML converter

I'm relatively new to programming and I was trying to work a project. I would like recommendations of how to annotate or comment my project and any improvement I could make to it, any suggestion is ...
Codepressed's user avatar
4 votes
1 answer
438 views

Create a CSV from SQL Data and email as attachment using PHP

I put together some functions that allows a PHP script to send the SQL data obtained from user inputs on a website via an email attachment as a CSV file. It works perfectly and I have no issues with ...
Surfboard's user avatar

1
2 3 4 5
13