Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Too many fields" Error #45

Closed
mmngtb opened this issue Jun 8, 2023 · 4 comments
Closed

"Too many fields" Error #45

mmngtb opened this issue Jun 8, 2023 · 4 comments

Comments

@mmngtb
Copy link

mmngtb commented Jun 8, 2023

Hello,

The plugin repeatedly gives me this error:

Plugin:obsidian-import-json:20962 [
{
"type": "FieldMismatch",
"code": "TooManyFields",
"message": "Too many fields: expected 1 fields but parsed 7",
"row": 0
},
{
"type": "FieldMismatch",
"code": "TooManyFields",
"message": "Too many fields: expected 1 fields but parsed 7",
"row": 1
}
]
convertCsv @ plugin:obsidian-import-json:20962
eval @ plugin:obsidian-import-json:21328
eval @ plugin:obsidian-import-json:49
__async @ plugin:obsidian-import-json:33
input5.onclick @ plugin:obsidian-import-json:21306
plugin:obsidian-import-json:20964 {
"delimiter": ",",
"linebreak": "\n",
"aborted": false,
"truncated": false,
"cursor": 1370,
"fields": [
"Question|Answer|References"
]
}
plugin:obsidian-import-json:21121 generateNotes('[object File]', 'undefined', [object Object] )

I'm using a pipe delimiter in this file and I don't think it's decoding my file correctly. I could be wrong. Does anyone have a solution to this?

Thanks

@farling42
Copy link
Owner

Are you using pipe separators on the first line of the file?
It is the first line that determines how many columns your table has (as well as the name of those fields).

@farling42
Copy link
Owner

Oh, I just noticed in the last section of your log that it is using a comma as the delimiter.
You might have to explicitly set the delimiter in the plugin's settings.

@farling42
Copy link
Owner

Actually I don't have a field in which to enter the delimiter; it is supposed to be detected automatically.

I see that the decoder is reading the entire first line as a single field "Question|Answer|References".

I am using the Papaparse library to do the decoding. As a test can you check if putting spaces either side of the "|" in the first line causes the detection of separator to work properly?

@mmngtb
Copy link
Author

mmngtb commented Jun 8, 2023

Thank you, adding the pipe on each end solved the issue! I appreciate the quick response!

@mmngtb mmngtb closed this as completed Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants