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

bugfix: replace newlines with _ in CSV cell values #5656

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

shun2wang
Copy link
Contributor

@shun2wang shun2wang commented Sep 9, 2024

Other data file will not have this problems because newlines in values were not allowed.

I think _ is better than a space, because space invisible sometimes, so that we should also change: https://github.com/jasp-stats/jaspColumnEncoder/blob/3425813804558ea0246351e3b361c19fffcf73f4/stringutils.h#L188 ?

@JorisGoosen
Copy link
Contributor

But what is the problem with newlines in values?
Right now they are read and used as they are.

While I agree users shouldnt really do that I think replacing them by '_' is a bit brusque.
Is there some bug you are trying to solve with this?

@shun2wang
Copy link
Contributor Author

shun2wang commented Sep 10, 2024

The vaule with newlines will overflow from cells after imported CSV, perhaps adjusting the cell height is an option, but I feel that there is a risk of line breaks appearing in the data anyway, which might cause confusion on the unpredictable R code side. I don't know, but overflowing the data view is an obvious problem right now.

@shun2wang
Copy link
Contributor Author

shun2wang commented Sep 10, 2024

I mean:
image

After:
image

Even we dont allow user input 'newline' inside cells right:-)

@JorisGoosen
Copy link
Contributor

Well, that is why I replaced the newlines with spaces :p

@JorisGoosen JorisGoosen merged commit d9847ab into jasp-stats:development Sep 16, 2024
1 check failed
@shun2wang shun2wang deleted the fixCsvNewlines branch September 16, 2024 12:03
JorisGoosen pushed a commit that referenced this pull request Sep 30, 2024
* bugfix: replace newlines with _ in CSV cell values

* replace newlines with spaces
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

Successfully merging this pull request may close these issues.

2 participants