Questions tagged [csvreader]

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.

172 questions
1
vote
1 answer

How to specify default int value for empty strings when using CsvDataReader in CsvHelper

I want to use CsvReader and CsvDataReader to load the input CSV into a DataTable, where the colums in the destination data table defines the data types. But for columns e.g. of int type, the CSV parsing fails when an empty string (;;) is found in a…
Brøgger
  • 25
  • 1
  • 5
1
vote
0 answers

Matplotlib plot is not showing a line

I want to make a line graph of the lowest price within three table columns. However the figure keeps returning a whole block instead of a line.enter image description here DATA TABLE a preview of the data table is given as a screenshot so you'll get…
Martijn Z.
  • 19
  • 3
1
vote
1 answer

Change delimiter in OpenCSV CSVReader

I have the following piece of code which reads a CSV file. public class TestMain { public static void parseTsv(String filePath) throws Exception { try (CSVReader reader = new CSVReader(new…
Stratos K
  • 341
  • 2
  • 14
1
vote
1 answer

LAB 3.14 Detecting Network Change - python - results not looping through csv index

I am learning Python using ZyBooks. This is LAB 3.14, "Detecting Network Change". The LAB provides a csv file to use to supply user credentials to be used in the evaluation. "This program is going to manage user login times and attempt to detect any…
rb5064
  • 11
  • 3
1
vote
1 answer

python CSV writer keep escape character

I have a CSV file, here are two lines in the file. c1,c2,c3,c4,c5 17939,2507974,11,DVD version has 1 hour of extras of 5 bonus matches including: - Stacy Keibler vs Torrie Wilson in a bikini contest. - A tour of Trish Stratus\' place. - Behind the…
Polaris
  • 366
  • 1
  • 4
  • 13
1
vote
0 answers

CSV reading is getting updated and incremented with each element instead of each rows

I have a c++ code for CSV reading. It is supposed to read the rows in accordance with the input. But it is reading only the first element of the input element row and is going to the next row giving me a diagonal output #ifndef CSVREADER_H #define…
1
vote
0 answers

CSV separator is present in one of the value. How to ignore/handle such csv file?

I'm getting CSV file from external system. CSV is separated using ; but one of the record has value with ; e.g: name;age;address ab:20;12345 s;m;30;12345 xy;22;12345 How can I consider s;m as single value? I'm using DataFrame of Joinery to…
shrikish
  • 11
  • 1
1
vote
1 answer

Is that possible to combine two csv files into one as mentiioned below

I am trying to combine csv file into one as below mentioned input1: Name,Age,Department Birla,52,Welding Rob,45,Furnace input2: YearofService,Audit 14,Y 8,N My expected output…
1
vote
1 answer

How to iterate through number of rows in csv file and append the values according to that

I need a small help.... Csv file sample : ID, name, age, city1,city2,city3 1, Andy, 25, "Ann Arbor,NA","CA,NA","MS,NA" 2, Bella, 40, "Los Angeles,NA" 3, Cathy, 13, "Eureka,NA","NV,NA" My current code : name=[] age=[] with open ('File_name','r') as…
Stay cool
  • 11
  • 6
1
vote
1 answer

Reading existing csv and then writing back to CSV puts inches expressed as double quotes in a cell as "" instead of \"

I have a CSV that I generate by building StringBuilder and writing to using PrintWriter. Then I read that CSV again and append something to it, but it messes up the cell which has double quotes in it, used to denote inches. It prints double-quotes…
Atihska
  • 4,803
  • 10
  • 56
  • 98
1
vote
1 answer

Use typing.Literal in dataclass reader

I have a csv file that I'd like to process to a dataclass. I'd like to check that the grades in my dataset are only from a prespecified list, if this is not the case I'd like to log an error/warning. My class looks as follows from dataclasses import…
Larsq
  • 315
  • 2
  • 12
1
vote
2 answers

What method is best for accomplishing this Parsing task?(Python)

I have a small parsing project I need to complete for work. With some suggestion I can complete this just need some ideas and ideas how to best clean this up. My task is to take a csv file(makes.csv) with lines like FYI I put those…
1
vote
1 answer

Typescript - Read CSV column by column

I am trying to read csv in typescript column by column. The csv is like below: Prefix,Suffix Mr,Jr Mrs,Sr Based on few SO questions and typescript documentation, I am able to read from file like: public readConfig() { const results: any[] =…
Mike
  • 721
  • 1
  • 17
  • 44
1
vote
2 answers

csv_reader read N lines at a time

I have to read a CSV file N lines at a time. csv_reader = csv.reader(csv_file, delimiter=',') line_count = 0 for row in csv_reader: print row I know I can loop N times at a time, build a list of list and process that way. But is…
Exploring
  • 2,493
  • 11
  • 56
  • 97
1
vote
1 answer

Importing and formatting a CSV in Python for plotting

I am fairly new to Python but understand what it is I need help with. I am trying to import a csv file which looks like this: Title of Project name1, Info 1 name2, Info 2 name3, Info 3 name4, Info 4 name5, Info…
UDG
  • 23
  • 5
1
2
3
11 12