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
1 answer
Reading specific columns from csv file
I have a csv file called beers.csv and I am trying to read 4 columns from it ( brewery_name, beer_style, beer_name, beer_abv) which are all column headers. I have the following code:
import csv
csvFile = "beers.csv"
csvData = csv.reader(csvFile,…

user3046782
- 19
- 1
- 3
0
votes
0 answers
csvReared.Read method dosn't read the memory stream
Please tell me tell me what I'm doing wrong
using (var mem = new MemoryStream())
{
var writer = new StreamWriter(mem);
writer.Write(csvText);
writer.Flush();
using (var reader = new StreamReader(mem))
{
mem.Seek(0,…

Andrew Koldyrev
- 1
- 4
0
votes
3 answers
Locate only the variable numeric data in filename in pandas column and place numbers in new column
I am using this code to pull in two CSVs of a similar naming convention, place their filenames in a "File" column and concatenate the dataframes into one dataframe called NatHrs.
import glob
from pathlib import Path
path =…

Hudson H.
- 15
- 5
0
votes
1 answer
python pandas csv_read put all row in first cell of the row
I am playing with famous titanic data. I have data csv with comma separation. And data looks like this:
passengerId,survived,pclass,name,sex,age,sibSp,parch,ticket,fare,cabin,embarked
1,0,3,"Braund, Mr. Owen Harris",male,22,1,0,A/5…

Karollo
- 45
- 7
0
votes
1 answer
R reading csv file i want to only one column with that row end with specific string value
** above image showing sample data list, so i want to get only record that content specific keyword end like (contact); on that row. **
data <- read.csv("csv.csv", sep = ',')
# Get the max salary from data frame.
Piname <-…

Mr Coder
- 507
- 3
- 13
-1
votes
1 answer
CSVReader "Script serialization error" for Unity
I have some really big problem.
I try to read my csv files using CSVReader, but I have an error, "Script serailzation"
What should I do? Please help me! Here is my code.
I'm trying to check my path and folders name, but I can't fix it.
//CSVReader…

BlackSperm
- 108
- 5
-1
votes
2 answers
How can two CSV files with the same data but different column orders be validated in Java?
I am trying to compare two CSV files that have the same data but columns in different orders. When the column orders match, the following code works: How can I tweak my following code to make it work when column orders don't match between the CSV…

ychaulagain
- 73
- 1
- 8
-1
votes
1 answer
How to read double quotes (") in CsvReader using c#?
I am trying to read a csv file using the following code. Its throwing an exception if there is double quotes (") in the data. I want to handle all the special chars while reading.
using (TextReader reader = new StreamReader("C:\\test\test.csv"))
{
…

aka baka
- 213
- 2
- 10
-1
votes
2 answers
How to read csv file to get output without list but in normal String?
I would like to ask how to change code to get output:
Nigel;UK;19
John;US;22
Carol;Germany;26
no this input (is it list?):
['Nigel', 'UK', '19']
['John', 'US', '22']
['Carol', 'Germany', '26']
code:
import csv
with open('friends.csv', 'r') as…

Mirek6
- 25
- 8
-1
votes
1 answer
Double Quote not close Java
J have CSV File first row is like this :
LOC;11000;"Autorisation "valide";10;;
When i try to read it with CSVReader i have only this:
LOC;11000
I know the problem is the double quote, how i can do to remove all double quote on my CSV ?
I try replace…

maa aam
- 1
- 3
-1
votes
1 answer
How to use csv reader to map columns from one file to another
I am new to Python csv.reader and I am trying to populate the data in sheet2 with the headers in sheet1:
sheet1.csv contains the following headers
1 2 3 4 5 6 7
sheet2.csv contains the following…

Girl007
- 165
- 1
- 13
-1
votes
2 answers
Converting for each loop to for loop java while reading csv data java
I have the following code:
try (CSVReader reader = new CSVReader(new FileReader(file))) {
List r = reader.readAll();
r.forEach(x -> System.out.println(Arrays.toString(x)));
}

Joe
- 57
- 1
- 9
-1
votes
2 answers
I am trying to confirm that this program is working properly, is there a way to output the values of these arrays to the console?
I am trying to confirm that this program is working properly, is there a way to output the values of these arrays to the console?
using System;
using Microsoft.VisualBasic.FileIO;
class ReadingCSV
{
public static void Main()
{
…

tylergallop94
- 13
- 1
-1
votes
1 answer
how to tell the for loop to read a file from the start?
While reading the CSV file in these lines:
csv_file = open(sys.argv[1], "r") # reading the csv file into memory
csv_reader = csv.DictReader(csv_file)
When I tried to make a copy of the csv_reader while using the for loop it worked, but any changes…

reham501
- 109
- 1
- 1
- 9
-1
votes
2 answers
How to assert if exe file that has had extension changed to csv is in fact a csv file
I'm needing to create a file validator that can check if the file type is correct. Originally we were just checking the content-type of the request, but as always our testers have managed to get around the restriction by simply changing the file…

Chris Marshall
- 740
- 1
- 9
- 25