-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Guessing wrong delimiter #804
Comments
Klingseis
pushed a commit
to Klingseis/PapaParse
that referenced
this issue
Jun 21, 2020
…igger than maxFieldCount (mholt#804)
Klingseis
pushed a commit
to Klingseis/PapaParse
that referenced
this issue
Jun 21, 2020
Klingseis
pushed a commit
to Klingseis/PapaParse
that referenced
this issue
Jun 21, 2020
I have the same issue, any solution ? |
I use PapaParse together with GUI. If a parsing error occurs or the result is only one column, a fieldset will be displayed to the user where he can type in a delimiter by his own and parse the file again. |
Will close this one. Only solution right now is to set the delimiter directly instead of guessing it by PapaParse. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In #687 there was new guessing of right delimiter added. Right now I'm facing the issue, that it predicts "," (Comma) instead of ";" (semicolon).
The reason for this seems to be the final checking if the previewed delimiter is better or not:
if ((typeof bestDelta === 'undefined' || delta <= bestDelta) && (typeof maxFieldCount === 'undefined' || avgFieldCount > maxFieldCount) && avgFieldCount > 1.99)
The delta for semicolon (0) is smaller than bestDelta (5) but the avgFieldCount equals maxFieldCount. For me this looks like you could assume that this delimiter is better, couldn't you?Maybe I am wrong, but wouldn't it be better to compare avgFieldCount >= maxFieldCount if the delta is smaller?
testGeometries.txt: File to reproduce similar issue.
One correction from my side: My thought above of comparing avgFieldCount >= maxFieldCount if delta is smaller doesn't work.
In attached file delimiter is semicolon, papaparse guesses comma:
comma delta: 4, comma avgFieldCount: 4.6
semicolon delta: 0, semicolon avgFieldCount: 3
The text was updated successfully, but these errors were encountered: