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
6
votes
5 answers

CSVHelper does not parse my Tab delimited CSV file

I am trying to read a tab delimited CSV file and parse it with CSVHelper. I have the following : _reader = new StreamReader(_stream); _csvReader = new CsvReader(_reader); _csvReader.Configuration.Delimiter = "\t"; but the reader fails to…
Danielle
  • 3,324
  • 2
  • 18
  • 31
5
votes
3 answers

How do you use the python alpha_vantage API to return extended intraday data?

I have been working with the alpha vantage python API for a while now, but I have only needed to pull daily and intraday timeseries data. I am trying to pull extended intraday data, but am not having any luck getting it to work. Trying to run the…
3
votes
1 answer

Java - Trying to find largest value in a specific column of a CSV

I was trying to find the largest value in a specific column but so far my code only prints that column on the console. How can I read through the last column only and find the largest value and print that entire row where the largest number is…
3
votes
2 answers

Read CSV over FTP line by line without storing the whole file in memory/disk

I'm stuck piping ftplib.FTP.retrlines to csv.reader... FTP.retrlines repeatedly calls a callback with a line in it, while csv.reader expects an iterator which returns a string each time its __next__() method is called. How do I combine the two…
neurino
  • 11,500
  • 2
  • 40
  • 63
3
votes
2 answers

What is Coder in String Value?

I am reading a CSV file, by using com.opencsv.CSVReader Like below String[] headers = csvReader.readNext(); Value for header is coming like below screen shot: What's coder here (Highlighted in yellow)? Why the value is 1 for first index and 0 for…
3
votes
2 answers

How to solve "java: package com.opencsv does not exist" in Maven with IntelliJ?

In Maven, I have quite a few dependencies that IntelliJ import. I also have the one for CSVReader com.opencsv opencsv 5.2 In the class that uses…
BobbKitty729
  • 327
  • 1
  • 6
  • 13
2
votes
2 answers

Pyhton csv reader: loop over csv files

I have several csv files that are named: list_csv_X with X going from 0 to 5. I would like to do a loop to read them with Python. I am currently doing it manually: for filepath in list_csv_0: with open(filepath,'r',encoding="utf8",…
Martin7
  • 93
  • 8
2
votes
4 answers

Python - How to create a list from csv file that has different row lengths?

I have a .csv file with 105 rows and 9 columns. Some of the rows only have values in four columns. How can I create a list from the .csv file without getting an IndexError: list index out of range? from elements import Element import csv filename =…
Sein
  • 21
  • 1
2
votes
1 answer

NIFI to check and validate datetime column values from CSV file for format `mm/dd/yyyy HH:mm:ss`. If Format matches treat as valid else invalid

Sample CSV data: emp_name,id,street_name,datetime abc,123,xyz,8/23/21 18:27 schema used: { "type" : "record", "namespace" : "sample", "name" : "sample_test", "fields" : [ { "name" : "emp_name", "type" : [ "null", "string"] ,…
itsmtech
  • 21
  • 1
  • 2
2
votes
2 answers

Process mixed bytes data into python list

I am reading data remote .dat files for EDI data processing. Original Data is some string bytes: b'MDA1MDtWMjAxOS44LjAuMDtWMjAxOS44LjAuMDsyMDIwMD.........' Used decode as below... byte_data = base64.b64decode(byte_data) Gave me this below byte…
NinjaBat
  • 370
  • 4
  • 20
2
votes
2 answers

The csv comparison is excluding duplicates in python

I have two csv files and i am using one csv to search all records from another csv and update its status. I have two tables and looking for IP and PROTOCOL from search table in input.csv. If it is there, then the EXISTS column is updated to 'No'. I…
Fatilearns
  • 33
  • 4
2
votes
0 answers

Is there a faster way to use csv reader in Java?

I need to open a csv file in more parts, each one by 5,000 samples and then plot them. To go back and forward on the signal each time I click a button I have to instantiate a new reader and than I skip to the point I need. My signal is big, is about…
Sam
  • 51
  • 6
2
votes
3 answers

Why is an exception thrown on parsing data from the first string array but not when skipping the first array?

In my system I have an Excel reader that also reads csv files. This is the way I read the csv file: Path path = Paths.get(this.getFilePath()); CSVParser parser = new CSVParserBuilder().withSeparator(';').build(); …
Hubi
  • 440
  • 1
  • 11
  • 25
2
votes
1 answer

Python CSV error: line contains NULL byte, but no NULL byte found in the file

I am trying to read some txt files, tab-delimited data and using the code below, it shows me the following error: for row in reader: Error: line contains NULL byte The code is basically trying to to get some information from specific columns. An…
2
votes
3 answers

CSV Reader Removing Double Quotes from First Field

I have a file which contains a tab delimited header and line like so: ID Field1 test1 "A","B" Here's my parsing script. with open(dataFile) as tsv: for line in csv.reader(tsv, delimiter='\t'): print(line) And the output: ['ID',…
YTsa
  • 55
  • 10
1
2 3
11 12