Questions tagged [csv-parser]

44 questions
5
votes
3 answers

Use csv-parser to only return file headers

I'm looking at the NPM package csv-parser that parses csv files to JSON. Based on the example provided, you can read a csv file row by row in the following manner: fs.createReadStream('data.csv') .pipe(csv()) .on('data', (rowData) =>…
blankface
  • 5,757
  • 19
  • 67
  • 114
3
votes
1 answer

How to read a CSV file, filter by a particular record and store it in different java object based on the records

I have a CSV file like below Rahul|S|74|72|71 Randy|T|20000|2 Abinav|T|30000|3 Amrit|S|82|81|80 The above csv has information about both student's and teacher's of a school. With the help of 2nd column we will be able to identify if the information…
krishna
  • 343
  • 2
  • 5
  • 19
2
votes
1 answer

Use Generics in Kotlin class for parsing CSV

I'm using CSVMapper in my kotlin code to parse a CSV file. Here's a sample code: data class UserDto(name: String): Serializable { } class CSVMigrator { private val csvFile: String private val csvMapper = CsvMapper().registerModule( …
Satyam
  • 15,493
  • 31
  • 131
  • 244
2
votes
0 answers

Using nest-csv-parser to parse CSV into objects

I have a structure of classes in Typescript that are nested. export class Vehicle { id: string; brand: string; owner: Owner; } export class Owner { id: string; name: string; } I then have a CSV file from which I intend to load this…
sant016
  • 195
  • 1
  • 2
  • 14
2
votes
1 answer

Library to parse CSV files, that is compatible with Angular 13+

I am making an Angular 13 project to parse CSV files but I am unable to find a package to parse the CSV Files, the ones I found by googling like "ngx-csv-parser" are not compatible with Angular 13. Can somebody please suggest a package compatible…
KUMAR HARSH
  • 95
  • 1
  • 10
2
votes
1 answer

Angular - Efficient way to parse 10000 rows of csv/tsv file

I'm looking for a more sufficient way (or lib) to parse csv/tsv that contains around 5000 ~ 10000 rows (using it to render a table with cdk virtual scroll for previewing the file). My current implementation is quite banana for that amount of…
Ethan Vu
  • 2,911
  • 9
  • 25
2
votes
1 answer

Adding fast random access in reading and parsing file using csv-parse and node

I was using the csv-parser library to handle csv parsing in node. The file can be huge ranging from 50,000 to 500,000 lines, maybe even larger. I had to perform some computations on the csv, after this is submitted to the server for that I was…
1
vote
1 answer

NodeJs Fetch and parse CSV file using csv-parser

I am trying to fetch the contents of a csv file from AWS S3 using axios and parse it using csv-parser it, then store the parsed data to my local database. Since the bucket/file is set to public, I'm pretty sure I don't need to include the…
indigo
  • 23
  • 3
1
vote
1 answer

Process the first row differently then pipe the rest to csv-parser

I have a CSV document with the following format: NOT_HEADER1|NOT_HEADER2|NOT_HEADER3... HEADER1|HEADER2|HEADER3|HEADER4|HEADER5|HEADER6 VALUE1|VALUE2|VALUE3|VALUE4|VALUE5|VALUE6 As the first line does not contain the actual headers, I can parse the…
iDaniel19
  • 75
  • 7
1
vote
2 answers

converting csv into json not working as planned in node.js

hi i have this csv file and i want to make it json so i can access data easily in node.js i use the csv-parser module and insted of returning an json/object like file it just returns a big…
1
vote
1 answer

Job/jar in Apache Flink doesn't have permisson to file in Docker

I have Apache Flink job for parsing csv-files which works fine in from IntelliJ IDEA on Windows. But when I put my job (jar) in docker-container Apache Flink i have problems with permisson to file with class FileSource.forRecordStreamFormat(...).…
Maria
  • 11
  • 2
1
vote
0 answers

How to take row header from CSV file

Okay so i have to read data from an CSV file and add methods that calculate which is seen in my code below, so my question is how can i put in output the header of a row (example first,second or third) from which the value has been taken…
DJezda
  • 11
  • 1
1
vote
0 answers

How to parse a huge CSV batch by batch using node

I have a CSV file with 8Mil records and want to read the CSV without loading the data into memory and parse it to an API after some data manipulation. So can anyone help me, who do I parse the data in batches as the API accepts 1000 records at a…
1
vote
2 answers

Parse csv using "csv-parser" node JS

I am using the 'csv-parser' library. Using the method below I am able to get the data stored in the birthdays array shown in the console: const birthdays = []; fs.createReadStream('./data/groupes.csv') .pipe(csv({})) …
1
vote
0 answers

What is causing a double comma in my csv output when using `",\n`?

I am writing a script that is designed to take in an array and replace a designated row in a csv(buffer) then output a csv(buffer) in nodejs. However, I have found that whenever I have the following combination of characters: ",\n", it is doubling…
1
2 3