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
How to Read and Write to the Same csv File?
I am trying to read and write to the same csv file, to specifically delete a row in a csv file if a certain header contains a value. My csv file looks like this:
Item #
Price
Quantity
Name
1
2.99
1
Muffin 1
2
3.99
2
Muffin…

py_coder1019
- 95
- 1
- 8
0
votes
1 answer
how do you combine columns into one field with CSVhelper
How do you combine columns into one field with CsvHelper?
I'm using CsvHelperby joshclose. Is possible to join two columns into one when doing the mapping?
I.e csv file has two headers, first and last name.
I want to combine then into one field call…

Trevor
- 21
- 4
0
votes
0 answers
skiplines in smooks mediator not working in wso2 ei
I am trying to read csv file in wso2 ei using the smooks mediator. csv to json conversion is working fine using the local entry.
but I want to escape the 1st line which is header in csv using the skipLines="1" tag.
it is not working.

aditi21
- 7
- 5
0
votes
1 answer
Pandas incorrectly reading csv file
I was trying to read one csv file using;
df= pd.read_csv('Diff_Report.csv',on_bad_lines='skip',encoding='cp1252',index_col=None)
Input Example
But the code outputs as in the following screenshot. Why is it happening like this?
Output

Ammu07
- 25
- 5
0
votes
3 answers
How to add Headers to read output from Python CSV File?
I have a csv file, with simply looks like this:
CSV File
I have the following code, which reads the csv file, and then can then print/ access information in the CSV file.
import csv
class CsvReader:
with open("Items.csv") as fp:
…

Fear_Schwier
- 3
- 2
0
votes
1 answer
How to remove single quotes and double quotes in csv file without pandas
I am printing the each data in csv file.While reading it was showing SingleQuotes and double quotes.I need to remove if it has any quotations in file
Sample csv file:
Name,Age,Year of…

Yes_par_row
- 79
- 6
0
votes
2 answers
Deleting a row from a CSV based on line number and shifting all lines afterwards
Let's say I have this CSV:
my friend hello, test
ok, no
whatever, test
test test, ok
I want to delete line number 3, so I would call my function:
remove_from_csv(3)
I couldn't find any built-in remove function and I don't want to "write" anything,…

Trigon
- 37
- 5
0
votes
3 answers
How to delete a particular column in csv file without pandas library
I am trying to delete particular columns in csv file.
CSV file:
Name,Age,YearofService,Department,Allocation
Birla,49,12,Welding,Production
Robin,38,10,Molding,Production
I am trying to delete Entire column having column header "Department" and…

Balaji R B
- 3
- 1
- 3
0
votes
2 answers
How to print only a the content of a cell in a specific row from a csv file in Python
I'm new to Python so excuse me if my question is kind of dumb.
I send some data into a csv file (I'm making a password manager). So I send this to this file (in this order), the name of the site, the e-mail corresponding and finally the…

th_o_mas
- 11
- 1
0
votes
1 answer
How to make columns as row using dict & map
My csv file:
Measure names,Measure values
State,CA
Audit,Y
WFH,Y
State,MN
Audit,N
WFH,N
State,SC
Audit,Y
WFH,Y
State,LA
Audit,N
WFH,N
State,CO
Audit,P
WFH,N
State,MO
Audit,Y
WFH,N
State,NY
Audit,N
WFH,Y
Expected output…

Stay cool
- 11
- 6
0
votes
0 answers
Is that possible to reshape/reorder csv file without using pandas library
I am extracting data from Tableau and generate a CSV file. I need to reshape the CSV file without using pandas library.My 3P policy wont allow to install any other packages. (Default package I am using is csv)
My generate CSV file…

Stay cool
- 11
- 6
0
votes
1 answer
Java -- How to enclose column names by double quotes
I need to read a CSV file, replace the column names with double quotes, and replace the file in the same location. Is there any way I can do that in Java?
My original sample columns were: col1, col2, col3
My desired columns: "col1", "col2",…

Chgn_Y
- 25
- 5
0
votes
1 answer
Reading dynamic header from csv file
I am working on an application where I send requests to get API which returns CSV with a large set of data. I need to read the list of data from CSV but the data headers are not consistent though they are the same their row number can be changed. I…

Muhammad Kamran
- 105
- 1
- 11
0
votes
1 answer
How to replace double quotes in headers and rows in a CSV file in Java
I'm new to Java. I have the following CSV file located in my local folder: C:\Users\MyFile\myFile.csv. The first line of the file is the header. I would like to replace the double quotes from headers and values in the file and replace the file in…

ychaulagain
- 73
- 1
- 8
0
votes
1 answer
How to get the Columns value by knowing a column name?
My current csv file :
'Date','Category','Ability'
'21,2,5','Sparrow','Air,land'
'4,5,6','Eagle','Air,Land'
Header is Date,category ,Ability....If i print the Date,then my expected output is [21,2,5,4,5,6]...but i get ['21,2,5','4,5,6']......
My…

Prasanna Balaji
- 51
- 1
- 8