A CsvReader represents a reader that provides forward-only access to a CSV text data source. A CsvReader may also support other delimited-separator formats.
Questions tagged [csvreader]
172 questions
0
votes
3 answers
Multi Processing python: Loop running extra times
I am trying to use multiprocessing to append to a csv file. I have multiple csv files that I am looping over. This function works with a normal for loop but does not work with multi-processing. Hope someone can shed some light on this.
My function…

meister
- 31
- 5
0
votes
1 answer
How do you name image files using a second column in the CSV file when using urllib?
I have a list of 100 images I want to download in a CSV file. There are no headers on the CSV. The first column has the location of the image and the second column has the name I would like the image saved as.
I am using urllib to download the…

jmarlow989
- 47
- 5
0
votes
0 answers
How to calculate number of rows and column in csv file without for loop
is there any way to find out the number of rows and columns in csv file without for loop and pandas library
My code :
file=b''join(file).split(b'\n')
row_count=0
col_count=0
for line in file:
row_count+=1
line=re.split(b''',()''',line) #regex
for…

Prasanna Balaji
- 51
- 1
- 8
0
votes
2 answers
break inner loops and pass control to outermost loop in python
Here is what I am looping through complex nested dictionaries inside a list called adm2_geonames. I then have a csv file whose line[1] needs to searched inside adm2_geonames. Once found, I want to break the loops for adm2_geonames i.e. starting…

Meana
- 23
- 2
- 11
0
votes
0 answers
Is there a way to read a file (CSVReader) from the end to the beginning?
maybe the answer to my question is not as straightforward as I'm thinking and also I can't find anything on the internet about it.
So let's say I have this:
String[] line;
BufferedReader data = new BufferedReader(new…

jgamb
- 15
- 5
0
votes
0 answers
Why is csv.reader not correctly outputting data?
My python code features a section which processes .pcap files into .csv files. Upon opening these files in excel, they are correctly formatted into cells, or if opened in a text editor, they are correctly formatted with "," delimiters.
However, when…

Rob Rorry
- 51
- 2
- 5
0
votes
0 answers
How to get Last Name of a Person from CSV file in flutter if First Name is selected by user?
Just to simplify my question , How to get Last Name of a Person from CSV file in flutter if First Name is selected by user from specific data given to him in Dropdown ?
Eg: If User select Tom in dropdown menu the Text widget should yeild Cruise
Data…

Jagdip Dhillon
- 13
- 4
0
votes
0 answers
Struggling with: "AttributeError: 'builtin_function_or_method' object has no attribute 'fieldnames'"
I'm struggling to break the following error down:
"AttributeError: 'builtin_function_or_method' object has no attribute 'fieldnames'"
I'm using the following code, which DOES work on Windows, unlike Linux... which is an issue, because I have to get…

Maurice
- 11
- 2
0
votes
1 answer
Looping unlimitedly because of csvreader
Hey there I'm making a game where you have to guess the name of a song with only the first letters and if you get it wrong once you get more letters twice is game over. (Not finished) But I have run into where my reading of my song csv file doesn't…

IPSM
- 71
- 1
- 7
0
votes
2 answers
How can this code be modified to work with CsvHelper/CsvReader to make the class more efficient for processing?
This question is a spin-off this one (Can this method be refactored to use a lamba?). In the comments to that question this was raised:
The refactoring needs to be done in a different place. It's not your function that sucks, it's the definition of…

Andrew Truckle
- 17,769
- 16
- 66
- 164
0
votes
1 answer
Python \n not working as part of the text to be printed, when read from a csv or text file
Here is the code explaining my problem:
from tkinter import *
import csv
root= Tk()
root.geometry("1080x720")
TextA, TextB = '',''
ListA = [["Unimportant Title"],["This is a sentence","\n I start the first line of the next line","\nHelp me"],…

Karan Hathwar
- 1
- 1
0
votes
1 answer
calculate the number of rows in a column that meet certain criteria (specific word and empty rows) by using Panda
From data in a csv file, I try to obtain using Panda, the sum of the rows of a specific column ("Status_Issue") of the csv file that are:
empty rows
and
rows containing the word "Pending".
Here is the code I used but unfortunately it doesn't work,…

mollieda
- 69
- 6
0
votes
0 answers
How to set a String parameter in a constructor equal to the contents of a CSV file?
I'm trying to write a constructor for a class I have called "CSVGameData", which is meant to feed certain list arrays in my abstract class called "GameData". The parameters I have for my constructor are two strings which are meant to basically take…

RelaxWithMyHorns
- 1
- 1
0
votes
1 answer
How to read _csv.reader object?
I have a _csv.reader type object that has been created by a function gathering data from an API. How would I open and parse this type of object, for processing in Pandas etc?
The object was initially created in this way:
obj =…

littlefield
- 55
- 5
0
votes
1 answer
Importing data into a react app for plotting
So I've been struggling to import CSV Data into my react app to plot it using deck.gl
Here are a couple of things I've tried so far :
Loading the data as a CSV file.
To do so I wrote up this bit of code to load the files:
import * as fs from…

Indrajeet Haldar
- 163
- 1
- 13