- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Index for header 'filename' is 1 but CSVRecord only has 1 values error
- Labels:
-
Apache NiFi
Created ‎07-12-2022 05:25 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello. I am simply spliting a csv file into two based on their row values. and when I run it through the QueryRecord processor, I get the error below. What could be the possible fix for this? Sample csv is as follows
Created on ‎07-12-2022 07:13 PM - edited ‎07-12-2022 07:30 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This error means that some line(s) in your flowfile have less than 4 fields. Empty lines are typically ignored but if you have a trailing line, for example, with a space in it, that space will be interpreted as the first field (GradeNm) and the other fields will be missing, which could lead to this sort of problem.
Check your input file for trailing lines or lines with less than 3 commas in it.
If the problem is being caused by a blank line with spaces, for example, you could use the ReplaceText processor to remove those spaces, as shown below:
Cheers,
André
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Created on ‎07-12-2022 07:13 PM - edited ‎07-12-2022 07:30 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This error means that some line(s) in your flowfile have less than 4 fields. Empty lines are typically ignored but if you have a trailing line, for example, with a space in it, that space will be interpreted as the first field (GradeNm) and the other fields will be missing, which could lead to this sort of problem.
Check your input file for trailing lines or lines with less than 3 commas in it.
If the problem is being caused by a blank line with spaces, for example, you could use the ReplaceText processor to remove those spaces, as shown below:
Cheers,
André
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Created ‎07-12-2022 07:28 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much for the help! this solved my problem
